]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/INFINITY.3
dist.mk, All pages: .TH: Generate date at 'make dist'
[thirdparty/man-pages.git] / man3 / INFINITY.3
1 .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH INFINITY 3 (date) "Linux man-pages (unreleased)"
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 .PP
16 .B INFINITY
17 .PP
18 .B NAN
19 .PP
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 .PP
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 .PP
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 C99.
59 .PP
60 On a glibc system, the macro
61 .B HUGE_VAL
62 is always available.
63 Availability of the
64 .B NAN
65 macro can be tested using
66 .BR "#ifdef NAN" ,
67 and similarly for
68 .BR INFINITY ,
69 .BR HUGE_VALF ,
70 .BR HUGE_VALL .
71 They will be defined by
72 .I <math.h>
73 if
74 .B _ISOC99_SOURCE
75 or
76 .B _GNU_SOURCE
77 is defined, or
78 .B __STDC_VERSION__
79 is defined
80 and has a value not less than 199901L.
81 .SH SEE ALSO
82 .BR fpclassify (3),
83 .BR math_error (7)