OSDN Git Service

(split) LDP: Update original to LDP v3.50.
[linuxjm/LDP_man-pages.git] / original / 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  2007-07-26 "" "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 .br
32 .B #include <math.h>
33 .sp
34 .B INFINITY
35 .sp
36 .B NAN
37 .sp
38 .B HUGE_VAL
39 .br
40 .B HUGE_VALF
41 .br
42 .B HUGE_VALL
43 .fi
44 .SH DESCRIPTION
45 The macro
46 .B INFINITY
47 expands to a \fIfloat\fP constant representing positive infinity.
48
49 The macro
50 .B NAN
51 expands to a \fIfloat\fP constant representing a quiet NaN
52 (when supported).
53 A
54 .I quiet
55 NaN is a NaN ("not-a-number") that does not raise exceptions
56 when it is used in arithmetic.
57 The opposite is a
58 .I signaling
59 NaN.
60 See IEC 60559:1989.
61
62 The macros
63 .BR HUGE_VAL ,
64 .BR HUGE_VALF ,
65 .B HUGE_VALL
66 expand to constants of types \fIdouble\fP, \fIfloat\fP
67 and \fIlong double\fP, respectively,
68 that represent a large positive value, possibly plus infinity.
69 .SH CONFORMING TO
70 C99.
71 .SH AVAILABILITY
72 On a glibc system, the macro
73 .B HUGE_VAL
74 is always available.
75 Availability of the
76 .B NAN
77 macro can be tested using
78 .BR "#ifdef NAN" ,
79 and similarly for
80 .BR INFINITY ,
81 .BR HUGE_VALF ,
82 .BR HUGE_VALL .
83 They will be defined by
84 .I <math.h>
85 if
86 .B _ISOC99_SOURCE
87 or
88 .B _GNU_SOURCE
89 is defined, or
90 .B __STDC_VERSION__
91 is defined
92 and has a value not less than 199901L.
93 .SH SEE ALSO
94 .BR fpclassify (3),
95 .BR math_error (7)