OSDN Git Service

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