|
Packit |
7cfc04 |
.\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_START(VERBATIM)
|
|
Packit |
7cfc04 |
.\" Permission is granted to make and distribute verbatim copies of this
|
|
Packit |
7cfc04 |
.\" manual provided the copyright notice and this permission notice are
|
|
Packit |
7cfc04 |
.\" preserved on all copies.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" Permission is granted to copy and distribute modified versions of this
|
|
Packit |
7cfc04 |
.\" manual under the conditions for verbatim copying, provided that the
|
|
Packit |
7cfc04 |
.\" entire resulting derived work is distributed under the terms of a
|
|
Packit |
7cfc04 |
.\" permission notice identical to this one.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
Packit |
7cfc04 |
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
Packit |
7cfc04 |
.\" responsibility for errors or omissions, or for damages resulting from
|
|
Packit |
7cfc04 |
.\" the use of the information contained herein. The author(s) may not
|
|
Packit |
7cfc04 |
.\" have taken the same level of care in the production of this manual,
|
|
Packit |
7cfc04 |
.\" which is licensed free of charge, as they might when working
|
|
Packit |
7cfc04 |
.\" professionally.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
Packit |
7cfc04 |
.\" the source, must acknowledge the copyright and authors of this work.
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_END
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.TH INFINITY 3 2017-09-15 "" "Linux Programmer's Manual"
|
|
Packit |
7cfc04 |
.SH NAME
|
|
Packit |
7cfc04 |
INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL \- floating-point constants
|
|
Packit |
7cfc04 |
.SH SYNOPSIS
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
.BR "#define _ISOC99_SOURCE" " /* See feature_test_macros(7) */"
|
|
Packit |
7cfc04 |
.B #include <math.h>
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.B INFINITY
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.B NAN
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.B HUGE_VAL
|
|
Packit |
7cfc04 |
.B HUGE_VALF
|
|
Packit |
7cfc04 |
.B HUGE_VALL
|
|
Packit |
7cfc04 |
.fi
|
|
Packit |
7cfc04 |
.SH DESCRIPTION
|
|
Packit |
7cfc04 |
The macro
|
|
Packit |
7cfc04 |
.B INFINITY
|
|
Packit |
7cfc04 |
expands to a
|
|
Packit |
7cfc04 |
.I float
|
|
Packit |
7cfc04 |
constant representing positive infinity.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
The macro
|
|
Packit |
7cfc04 |
.B NAN
|
|
Packit |
7cfc04 |
expands to a
|
|
Packit |
7cfc04 |
.I float
|
|
Packit |
7cfc04 |
constant representing a quiet NaN
|
|
Packit |
7cfc04 |
(when supported).
|
|
Packit |
7cfc04 |
A
|
|
Packit |
7cfc04 |
.I quiet
|
|
Packit |
7cfc04 |
NaN is a NaN ("not-a-number") that does not raise exceptions
|
|
Packit |
7cfc04 |
when it is used in arithmetic.
|
|
Packit |
7cfc04 |
The opposite is a
|
|
Packit |
7cfc04 |
.I signaling
|
|
Packit |
7cfc04 |
NaN.
|
|
Packit |
7cfc04 |
See IEC 60559:1989.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
The macros
|
|
Packit |
7cfc04 |
.BR HUGE_VAL ,
|
|
Packit |
7cfc04 |
.BR HUGE_VALF ,
|
|
Packit |
7cfc04 |
.B HUGE_VALL
|
|
Packit |
7cfc04 |
expand to constants of types
|
|
Packit |
7cfc04 |
.IR double ,
|
|
Packit |
7cfc04 |
.I float
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.IR "long double" ,
|
|
Packit |
7cfc04 |
respectively,
|
|
Packit |
7cfc04 |
that represent a large positive value, possibly positive infinity.
|
|
Packit |
7cfc04 |
.SH CONFORMING TO
|
|
Packit |
7cfc04 |
C99.
|
|
Packit |
7cfc04 |
.SH AVAILABILITY
|
|
Packit |
7cfc04 |
On a glibc system, the macro
|
|
Packit |
7cfc04 |
.B HUGE_VAL
|
|
Packit |
7cfc04 |
is always available.
|
|
Packit |
7cfc04 |
Availability of the
|
|
Packit |
7cfc04 |
.B NAN
|
|
Packit |
7cfc04 |
macro can be tested using
|
|
Packit |
7cfc04 |
.BR "#ifdef NAN" ,
|
|
Packit |
7cfc04 |
and similarly for
|
|
Packit |
7cfc04 |
.BR INFINITY ,
|
|
Packit |
7cfc04 |
.BR HUGE_VALF ,
|
|
Packit |
7cfc04 |
.BR HUGE_VALL .
|
|
Packit |
7cfc04 |
They will be defined by
|
|
Packit |
7cfc04 |
.I <math.h>
|
|
Packit |
7cfc04 |
if
|
|
Packit |
7cfc04 |
.B _ISOC99_SOURCE
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.B _GNU_SOURCE
|
|
Packit |
7cfc04 |
is defined, or
|
|
Packit |
7cfc04 |
.B __STDC_VERSION__
|
|
Packit |
7cfc04 |
is defined
|
|
Packit |
7cfc04 |
and has a value not less than 199901L.
|
|
Packit |
7cfc04 |
.SH SEE ALSO
|
|
Packit |
7cfc04 |
.BR fpclassify (3),
|
|
Packit |
7cfc04 |
.BR math_error (7)
|
|
Packit |
7cfc04 |
.SH COLOPHON
|
|
Packit |
7cfc04 |
This page is part of release 4.15 of the Linux
|
|
Packit |
7cfc04 |
.I man-pages
|
|
Packit |
7cfc04 |
project.
|
|
Packit |
7cfc04 |
A description of the project,
|
|
Packit |
7cfc04 |
information about reporting bugs,
|
|
Packit |
7cfc04 |
and the latest version of this page,
|
|
Packit |
7cfc04 |
can be found at
|
|
Packit |
7cfc04 |
\%https://www.kernel.org/doc/man\-pages/.
|