OSDN Git Service

(split) LDP: Update original to LDP v3.52.
[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
48 .I float
49 constant representing positive infinity.
50
51 The macro
52 .B NAN
53 expands to a
54 .I float
55 constant representing a quiet NaN
56 (when supported).
57 A
58 .I quiet
59 NaN is a NaN ("not-a-number") that does not raise exceptions
60 when it is used in arithmetic.
61 The opposite is a
62 .I signaling
63 NaN.
64 See IEC 60559:1989.
65
66 The macros
67 .BR HUGE_VAL ,
68 .BR HUGE_VALF ,
69 .B HUGE_VALL
70 expand to constants of types
71 .IR double ,
72 .I float
73 and
74 .IR "long double" ,
75 respectively,
76 that represent a large positive value, possibly plus infinity.
77 .SH CONFORMING TO
78 C99.
79 .SH AVAILABILITY
80 On a glibc system, the macro
81 .B HUGE_VAL
82 is always available.
83 Availability of the
84 .B NAN
85 macro can be tested using
86 .BR "#ifdef NAN" ,
87 and similarly for
88 .BR INFINITY ,
89 .BR HUGE_VALF ,
90 .BR HUGE_VALL .
91 They will be defined by
92 .I <math.h>
93 if
94 .B _ISOC99_SOURCE
95 or
96 .B _GNU_SOURCE
97 is defined, or
98 .B __STDC_VERSION__
99 is defined
100 and has a value not less than 199901L.
101 .SH SEE ALSO
102 .BR fpclassify (3),
103 .BR math_error (7)