]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/INFINITY.3
ctime.3: wfix
[thirdparty/man-pages.git] / man3 / INFINITY.3
CommitLineData
fea681da
MK
1.\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
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.
c13182ef 12.\"
fea681da
MK
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.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da 24.\"
4b8c67d9 25.TH INFINITY 3 2017-09-15 "" "Linux Programmer's Manual"
fea681da 26.SH NAME
c45bd688 27INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL \- floating-point constants
fea681da
MK
28.SH SYNOPSIS
29.nf
b80f966b 30.BR "#define _ISOC99_SOURCE" " /* See feature_test_macros(7) */"
fea681da 31.B #include <math.h>
68e4db0a 32.PP
fea681da 33.B INFINITY
68e4db0a 34.PP
fea681da 35.B NAN
68e4db0a 36.PP
fea681da 37.B HUGE_VAL
fea681da 38.B HUGE_VALF
fea681da
MK
39.B HUGE_VALL
40.fi
41.SH DESCRIPTION
42The macro
43.B INFINITY
c6fa0841
MK
44expands to a
45.I float
46constant representing positive infinity.
847e0d88 47.PP
fea681da
MK
48The macro
49.B NAN
c6fa0841
MK
50expands to a
51.I float
52constant representing a quiet NaN
c13182ef
MK
53(when supported).
54A
fea681da
MK
55.I quiet
56NaN is a NaN ("not-a-number") that does not raise exceptions
c13182ef
MK
57when it is used in arithmetic.
58The opposite is a
d9bfdb9c 59.I signaling
c13182ef
MK
60NaN.
61See IEC 60559:1989.
847e0d88 62.PP
fea681da
MK
63The macros
64.BR HUGE_VAL ,
65.BR HUGE_VALF ,
0daa9e92 66.B HUGE_VALL
c6fa0841
MK
67expand to constants of types
68.IR double ,
69.I float
70and
71.IR "long double" ,
72respectively,
fa797358 73that represent a large positive value, possibly positive infinity.
47297adb 74.SH CONFORMING TO
44a2c328 75C99.
fea681da 76.SH AVAILABILITY
2f0af33b
MK
77On a glibc system, the macro
78.B HUGE_VAL
79is always available.
80Availability of the
81.B NAN
82macro can be tested using
fea681da 83.BR "#ifdef NAN" ,
2f0af33b
MK
84and similarly for
85.BR INFINITY ,
86.BR HUGE_VALF ,
87.BR HUGE_VALL .
fea681da
MK
88They will be defined by
89.I <math.h>
c3dfd2c8
MK
90if
91.B _ISOC99_SOURCE
92or
93.B _GNU_SOURCE
2f0af33b
MK
94is defined, or
95.B __STDC_VERSION__
96is defined
fea681da 97and has a value not less than 199901L.
47297adb 98.SH SEE ALSO
0a90178c 99.BR fpclassify (3),
a81ff34c 100.BR math_error (7)