Debian Codegraph @

upstream/debian-trixie/man3/INFINITY.3

raw
1 .\" Copyright 2004 Andries Brouwer <[email protected]>.
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH INFINITY 3 2024-05-02 "Linux man-pages 6.9.1"
6 .SH NAME
7 INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL \- floating-point constants
8 .SH LIBRARY
9 Math library
10 .RI ( libm )
11 .SH SYNOPSIS
12 .nf
13 .BR "#define _ISOC99_SOURCE" " /* See feature_test_macros(7) */"
14 .B #include <math.h>
15 .P
16 .B INFINITY
17 .P
18 .B NAN
19 .P
20 .B HUGE_VAL
21 .B HUGE_VALF
22 .B HUGE_VALL
23 .fi
24 .SH DESCRIPTION
25 The macro
26 .B INFINITY
27 expands to a
28 .I float
29 constant representing positive infinity.
30 .P
31 The macro
32 .B NAN
33 expands to a
34 .I float
35 constant representing a quiet NaN
36 (when supported).
37 A
38 .I quiet
39 NaN is a NaN ("not-a-number") that does not raise exceptions
40 when it is used in arithmetic.
41 The opposite is a
42 .I signaling
43 NaN.
44 See IEC 60559:1989.
45 .P
46 The macros
47 .BR HUGE_VAL ,
48 .BR HUGE_VALF ,
49 .B HUGE_VALL
50 expand to constants of types
51 .IR double ,
52 .IR float ,
53 and
54 .IR "long double" ,
55 respectively,
56 that represent a large positive value, possibly positive infinity.
57 .SH STANDARDS
58 C11.
59 .SH HISTORY
60 C99.
61 .P
62 On a glibc system, the macro
63 .B HUGE_VAL
64 is always available.
65 Availability of the
66 .B NAN
67 macro can be tested using
68 .BR "#ifdef NAN" ,
69 and similarly for
70 .BR INFINITY ,
71 .BR HUGE_VALF ,
72 .BR HUGE_VALL .
73 They will be defined by
74 .I <math.h>
75 if
76 .B _ISOC99_SOURCE
77 or
78 .B _GNU_SOURCE
79 is defined, or
80 .B __STDC_VERSION__
81 is defined
82 and has a value not less than 199901L.
83 .SH SEE ALSO
84 .BR fpclassify (3),
85 .BR math_error (7)