]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>. |
2 | .\" | |
3 | .\" Permission is granted to make and distribute verbatim copies of this | |
4 | .\" manual provided the copyright notice and this permission notice are | |
5 | .\" preserved on all copies. | |
6 | .\" | |
7 | .\" Permission is granted to copy and distribute modified versions of this | |
8 | .\" manual under the conditions for verbatim copying, provided that the | |
9 | .\" entire resulting derived work is distributed under the terms of a | |
10 | .\" permission notice identical to this one. | |
c13182ef | 11 | .\" |
fea681da MK |
12 | .\" Since the Linux kernel and libraries are constantly changing, this |
13 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
14 | .\" responsibility for errors or omissions, or for damages resulting from | |
15 | .\" the use of the information contained herein. The author(s) may not | |
16 | .\" have taken the same level of care in the production of this manual, | |
17 | .\" which is licensed free of charge, as they might when working | |
18 | .\" professionally. | |
c13182ef | 19 | .\" |
fea681da MK |
20 | .\" Formatted or processed versions of this manual, if unaccompanied by |
21 | .\" the source, must acknowledge the copyright and authors of this work. | |
22 | .\" | |
23 | .TH INFINITY 3 2004-10-31 "" "Linux Programmer's Manual" | |
24 | .SH NAME | |
c65433e6 | 25 | INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL \- floating point constants |
fea681da MK |
26 | .SH SYNOPSIS |
27 | .nf | |
28 | #define _ISOC99_SOURCE | |
29 | .br | |
30 | .B #include <math.h> | |
31 | .sp | |
32 | .B INFINITY | |
33 | .sp | |
34 | .B NAN | |
35 | .sp | |
36 | .B HUGE_VAL | |
37 | .br | |
38 | .B HUGE_VALF | |
39 | .br | |
40 | .B HUGE_VALL | |
41 | .fi | |
42 | .SH DESCRIPTION | |
43 | The macro | |
44 | .B INFINITY | |
45 | expands to a float constant representing positive infinity. | |
46 | ||
47 | The macro | |
48 | .B NAN | |
49 | expands to a float constant representing a quiet NaN | |
c13182ef MK |
50 | (when supported). |
51 | A | |
fea681da MK |
52 | .I quiet |
53 | NaN is a NaN ("not-a-number") that does not raise exceptions | |
c13182ef MK |
54 | when it is used in arithmetic. |
55 | The opposite is a | |
d9bfdb9c | 56 | .I signaling |
c13182ef MK |
57 | NaN. |
58 | See IEC 60559:1989. | |
fea681da MK |
59 | |
60 | The macros | |
61 | .BR HUGE_VAL , | |
62 | .BR HUGE_VALF , | |
63 | .BR HUGE_VALL | |
64 | expand to constants of types double, float and long double, respectively, | |
65 | that represent a large positive value, possibly plus infinity. | |
2b2581ee MK |
66 | .SH "CONFORMING TO" |
67 | C99 | |
fea681da MK |
68 | .SH AVAILABILITY |
69 | On a glibc system, the macro HUGE_VAL is always available. | |
70 | Availability of the NAN macro can be tested using | |
71 | .BR "#ifdef NAN" , | |
72 | and similarly for INFINITY, HUGE_VALF, HUGE_VALL. | |
73 | They will be defined by | |
74 | .I <math.h> | |
75 | if _ISOC99_SOURCE or _GNU_SOURCE is defined, or __STDC_VERSION__ is defined | |
76 | and has a value not less than 199901L. | |
fea681da | 77 | .SH "SEE ALSO" |
0a90178c MK |
78 | .BR fpclassify (3), |
79 | .BR feature_test_macros (7) |