]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>. |
2 | .\" | |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da | 4 | .\" |
45186a5d | 5 | .TH FINITE 3 2021-03-22 "Linux man-pages (unreleased)" |
fea681da MK |
6 | .SH NAME |
7 | finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl \- | |
c45bd688 | 8 | BSD floating-point classification functions |
59b669f7 AC |
9 | .SH LIBRARY |
10 | Math library | |
8fc3b2cf | 11 | .RI ( libm ", " \-lm ) |
fea681da MK |
12 | .SH SYNOPSIS |
13 | .nf | |
fea681da | 14 | .B #include <math.h> |
68e4db0a | 15 | .PP |
fea681da | 16 | .BI "int finite(double " x ); |
fea681da | 17 | .BI "int finitef(float " x ); |
fea681da | 18 | .BI "int finitel(long double " x ); |
68e4db0a | 19 | .PP |
fea681da | 20 | .BI "int isinf(double " x ); |
fea681da | 21 | .BI "int isinff(float " x ); |
fea681da | 22 | .BI "int isinfl(long double " x ); |
68e4db0a | 23 | .PP |
fea681da | 24 | .BI "int isnan(double " x ); |
fea681da | 25 | .BI "int isnanf(float " x ); |
fea681da MK |
26 | .BI "int isnanl(long double " x ); |
27 | .fi | |
68e4db0a | 28 | .PP |
d39ad78f | 29 | .RS -4 |
cc4615cc MK |
30 | Feature Test Macro Requirements for glibc (see |
31 | .BR feature_test_macros (7)): | |
d39ad78f | 32 | .RE |
68e4db0a | 33 | .PP |
cc4615cc MK |
34 | .BR finite (), |
35 | .BR finitef (), | |
36 | .BR finitel (): | |
9d2adbae MK |
37 | .nf |
38 | /* Glibc since 2.19: */ _DEFAULT_SOURCE | |
39 | || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
98c9347c | 40 | .PP |
7fde78e6 | 41 | .BR isinf (): |
5c10d2c5 | 42 | _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE |
9d2adbae MK |
43 | || /* Glibc since 2.19: */ _DEFAULT_SOURCE |
44 | || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
45 | .fi | |
98c9347c | 46 | .PP |
cc4615cc MK |
47 | .BR isinff (), |
48 | .BR isinfl (): | |
9d2adbae MK |
49 | .nf |
50 | /* Glibc since 2.19: */ _DEFAULT_SOURCE | |
51 | || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
52 | .fi | |
98c9347c | 53 | .PP |
7fde78e6 | 54 | .BR isnan (): |
9d2adbae MK |
55 | .nf |
56 | _XOPEN_SOURCE || _ISOC99_SOURCE | |
57 | || /* Glibc since 2.19: */ _DEFAULT_SOURCE | |
58 | || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
59 | .fi | |
98c9347c | 60 | .PP |
cc4615cc MK |
61 | .BR isnanf (), |
62 | .BR isnanl (): | |
9d2adbae | 63 | .nf |
5c10d2c5 | 64 | _XOPEN_SOURCE >= 600 |
9d2adbae MK |
65 | || /* Glibc since 2.19: */ _DEFAULT_SOURCE |
66 | || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
67 | .fi | |
fea681da MK |
68 | .SH DESCRIPTION |
69 | The | |
5ad225a3 PH |
70 | .BR finite (), |
71 | .BR finitef (), | |
72 | and | |
73 | .BR finitel () | |
c6fa0841 MK |
74 | functions return a nonzero value if |
75 | .I x | |
76 | is neither infinite | |
fea681da | 77 | nor a "not-a-number" (NaN) value, and 0 otherwise. |
847e0d88 | 78 | .PP |
fea681da | 79 | The |
5ad225a3 PH |
80 | .BR isnan (), |
81 | .BR isnanf (), | |
82 | and | |
83 | .BR isnanl () | |
c6fa0841 MK |
84 | functions return a nonzero value if |
85 | .I x | |
86 | is a NaN value, | |
fea681da | 87 | and 0 otherwise. |
847e0d88 | 88 | .PP |
fea681da | 89 | The |
5ad225a3 PH |
90 | .BR isinf (), |
91 | .BR isinff (), | |
92 | and | |
93 | .BR isinfl () | |
c6fa0841 MK |
94 | functions return 1 if |
95 | .I x | |
96 | is positive infinity, \-1 if | |
97 | .I x | |
6457ee5a | 98 | is negative infinity, and 0 otherwise. |
77aa3ddc | 99 | .SH ATTRIBUTES |
a3a57673 MK |
100 | For an explanation of the terms used in this section, see |
101 | .BR attributes (7). | |
c466875e MK |
102 | .ad l |
103 | .nh | |
a3a57673 MK |
104 | .TS |
105 | allbox; | |
c466875e | 106 | lbx lb lb |
a3a57673 MK |
107 | l l l. |
108 | Interface Attribute Value | |
109 | T{ | |
77aa3ddc PH |
110 | .BR finite (), |
111 | .BR finitef (), | |
112 | .BR finitel (), | |
113 | .BR isinf (), | |
114 | .BR isinff (), | |
115 | .BR isinfl (), | |
116 | .BR isnan (), | |
117 | .BR isnanf (), | |
77aa3ddc | 118 | .BR isnanl () |
a3a57673 MK |
119 | T} Thread safety MT-Safe |
120 | .TE | |
c466875e MK |
121 | .hy |
122 | .ad | |
123 | .sp 1 | |
19c98696 | 124 | .SH NOTES |
c13182ef MK |
125 | Note that these functions are obsolete. |
126 | C99 defines macros | |
b4e00e78 | 127 | .BR isfinite (), |
efca8360 MK |
128 | .BR isinf (), |
129 | and | |
130 | .BR isnan () | |
131 | (for all types) replacing them. | |
132 | Further note that the C99 | |
133 | .BR isinf () | |
134 | has weaker guarantees on the return value. | |
fea681da MK |
135 | See |
136 | .BR fpclassify (3). | |
137 | .\" | |
138 | .\" finite* not on HP-UX; they exist on Tru64. | |
889829be MK |
139 | .\" .SH HISTORY |
140 | .\" The | |
141 | .\" .BR finite () | |
142 | .\" function occurs in 4.3BSD. | |
b14d4aa5 | 143 | .\" see IEEE.3 in the 4.3BSD manual |
47297adb | 144 | .SH SEE ALSO |
cc4615cc | 145 | .BR fpclassify (3) |