1INFINITY(3) Linux Programmer's Manual INFINITY(3)
2
3
4
6 INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL - floating point con‐
7 stants
8
10 #define _ISOC99_SOURCE
11 #include <math.h>
12
13 INFINITY
14
15 NAN
16
17 HUGE_VAL
18 HUGE_VALF
19 HUGE_VALL
20
22 The macro INFINITY expands to a float constant representing positive
23 infinity.
24
25 The macro NAN expands to a float constant representing a quiet NaN
26 (when supported). A quiet NaN is a NaN ("not-a-number") that does not
27 raise exceptions when it is used in arithmetic. The opposite is a sig‐
28 nalling NaN. See IEC 60559:1989.
29
30 The macros HUGE_VAL, HUGE_VALF, HUGE_VALL expand to constants of types
31 double, float and long double, respectively, that represent a large
32 positive value, possibly plus infinity.
33
34
36 On a glibc system, the macro HUGE_VAL is always available. Availabil‐
37 ity of the NAN macro can be tested using #ifdef NAN, and similarly for
38 INFINITY, HUGE_VALF, HUGE_VALL. They will be defined by <math.h> if
39 _ISOC99_SOURCE or _GNU_SOURCE is defined, or __STDC_VERSION__ is
40 defined and has a value not less than 199901L.
41
42
44 C99
45
47 fpclassify(3), feature_test_macros(7)
48
49
50
51 2004-10-31 INFINITY(3)