]>
Commit | Line | Data |
---|---|---|
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 FINITE 3 2017-09-15 "" "Linux Programmer's Manual" |
fea681da MK |
26 | .SH NAME |
27 | finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl \- | |
c45bd688 | 28 | BSD floating-point classification functions |
fea681da MK |
29 | .SH SYNOPSIS |
30 | .nf | |
fea681da | 31 | .B #include <math.h> |
68e4db0a | 32 | .PP |
fea681da | 33 | .BI "int finite(double " x ); |
fea681da | 34 | .BI "int finitef(float " x ); |
fea681da | 35 | .BI "int finitel(long double " x ); |
68e4db0a | 36 | .PP |
fea681da | 37 | .BI "int isinf(double " x ); |
fea681da | 38 | .BI "int isinff(float " x ); |
fea681da | 39 | .BI "int isinfl(long double " x ); |
68e4db0a | 40 | .PP |
fea681da | 41 | .BI "int isnan(double " x ); |
fea681da | 42 | .BI "int isnanf(float " x ); |
fea681da MK |
43 | .BI "int isnanl(long double " x ); |
44 | .fi | |
68e4db0a | 45 | .PP |
cc4615cc MK |
46 | .in -4n |
47 | Feature Test Macro Requirements for glibc (see | |
48 | .BR feature_test_macros (7)): | |
49 | .in | |
68e4db0a | 50 | .PP |
cc4615cc MK |
51 | .ad l |
52 | .BR finite (), | |
53 | .BR finitef (), | |
54 | .BR finitel (): | |
63349ee5 | 55 | .RS 4 |
d59161f9 MK |
56 | /* Glibc since 2.19: */ _DEFAULT_SOURCE |
57 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
63349ee5 | 58 | .RE |
7fde78e6 | 59 | .BR isinf (): |
63349ee5 | 60 | .RS 4 |
d59161f9 MK |
61 | _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE |
62 | || /* Glibc since 2.19: */ _DEFAULT_SOURCE | |
63 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
63349ee5 | 64 | .RE |
7fde78e6 | 65 | .br |
cc4615cc MK |
66 | .BR isinff (), |
67 | .BR isinfl (): | |
63349ee5 | 68 | .RS 4 |
d59161f9 MK |
69 | /* Glibc since 2.19: */ _DEFAULT_SOURCE |
70 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
63349ee5 | 71 | .RE |
7fde78e6 | 72 | .BR isnan (): |
63349ee5 | 73 | .RS 4 |
d59161f9 MK |
74 | _XOPEN_SOURCE || _ISOC99_SOURCE |
75 | || /* Glibc since 2.19: */ _DEFAULT_SOURCE | |
76 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
63349ee5 | 77 | .RE |
cc4615cc MK |
78 | .BR isnanf (), |
79 | .BR isnanl (): | |
63349ee5 | 80 | .RS 4 |
d59161f9 MK |
81 | _XOPEN_SOURCE\ >=\ 600 |
82 | || /* Glibc since 2.19: */ _DEFAULT_SOURCE | |
83 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
63349ee5 | 84 | .RE |
cc4615cc | 85 | .ad b |
fea681da MK |
86 | .SH DESCRIPTION |
87 | The | |
5ad225a3 PH |
88 | .BR finite (), |
89 | .BR finitef (), | |
90 | and | |
91 | .BR finitel () | |
c6fa0841 MK |
92 | functions return a nonzero value if |
93 | .I x | |
94 | is neither infinite | |
fea681da | 95 | nor a "not-a-number" (NaN) value, and 0 otherwise. |
847e0d88 | 96 | .PP |
fea681da | 97 | The |
5ad225a3 PH |
98 | .BR isnan (), |
99 | .BR isnanf (), | |
100 | and | |
101 | .BR isnanl () | |
c6fa0841 MK |
102 | functions return a nonzero value if |
103 | .I x | |
104 | is a NaN value, | |
fea681da | 105 | and 0 otherwise. |
847e0d88 | 106 | .PP |
fea681da | 107 | The |
5ad225a3 PH |
108 | .BR isinf (), |
109 | .BR isinff (), | |
110 | and | |
111 | .BR isinfl () | |
c6fa0841 MK |
112 | functions return 1 if |
113 | .I x | |
114 | is positive infinity, \-1 if | |
115 | .I x | |
6457ee5a | 116 | is negative infinity, and 0 otherwise. |
77aa3ddc | 117 | .SH ATTRIBUTES |
a3a57673 MK |
118 | For an explanation of the terms used in this section, see |
119 | .BR attributes (7). | |
120 | .TS | |
121 | allbox; | |
122 | lbw31 lb lb | |
123 | l l l. | |
124 | Interface Attribute Value | |
125 | T{ | |
77aa3ddc PH |
126 | .BR finite (), |
127 | .BR finitef (), | |
128 | .BR finitel (), | |
a3a57673 | 129 | .br |
77aa3ddc PH |
130 | .BR isinf (), |
131 | .BR isinff (), | |
132 | .BR isinfl (), | |
a3a57673 | 133 | .br |
77aa3ddc PH |
134 | .BR isnan (), |
135 | .BR isnanf (), | |
77aa3ddc | 136 | .BR isnanl () |
a3a57673 MK |
137 | T} Thread safety MT-Safe |
138 | .TE | |
19c98696 | 139 | .SH NOTES |
c13182ef MK |
140 | Note that these functions are obsolete. |
141 | C99 defines macros | |
b4e00e78 | 142 | .BR isfinite (), |
efca8360 MK |
143 | .BR isinf (), |
144 | and | |
145 | .BR isnan () | |
146 | (for all types) replacing them. | |
147 | Further note that the C99 | |
148 | .BR isinf () | |
149 | has weaker guarantees on the return value. | |
fea681da MK |
150 | See |
151 | .BR fpclassify (3). | |
152 | .\" | |
153 | .\" finite* not on HP-UX; they exist on Tru64. | |
889829be MK |
154 | .\" .SH HISTORY |
155 | .\" The | |
156 | .\" .BR finite () | |
157 | .\" function occurs in 4.3BSD. | |
b14d4aa5 | 158 | .\" see IEEE.3 in the 4.3BSD manual |
47297adb | 159 | .SH SEE ALSO |
cc4615cc | 160 | .BR fpclassify (3) |