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