]>
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 | .\" |
77aa3ddc | 25 | .TH FINITE 3 2013-07-22 "" "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 MK |
31 | .B #include <math.h> |
32 | .sp | |
33 | .BI "int finite(double " x ); | |
34 | .br | |
35 | .BI "int finitef(float " x ); | |
36 | .br | |
37 | .BI "int finitel(long double " x ); | |
38 | .sp | |
39 | .BI "int isinf(double " x ); | |
40 | .br | |
41 | .BI "int isinff(float " x ); | |
42 | .br | |
43 | .BI "int isinfl(long double " x ); | |
44 | .sp | |
45 | .BI "int isnan(double " x ); | |
46 | .br | |
47 | .BI "int isnanf(float " x ); | |
48 | .br | |
49 | .BI "int isnanl(long double " x ); | |
50 | .fi | |
cc4615cc MK |
51 | .sp |
52 | .in -4n | |
53 | Feature Test Macro Requirements for glibc (see | |
54 | .BR feature_test_macros (7)): | |
55 | .in | |
56 | .sp | |
57 | .ad l | |
58 | .BR finite (), | |
59 | .BR finitef (), | |
60 | .BR finitel (): | |
63349ee5 | 61 | .RS 4 |
cc4615cc | 62 | _BSD_SOURCE || _SVID_SOURCE |
63349ee5 | 63 | .RE |
7fde78e6 | 64 | .BR isinf (): |
63349ee5 | 65 | .RS 4 |
7fde78e6 | 66 | _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; |
63349ee5 MK |
67 | .br |
68 | or | |
7fde78e6 | 69 | .I cc\ -std=c99 |
63349ee5 | 70 | .RE |
7fde78e6 | 71 | .br |
cc4615cc MK |
72 | .BR isinff (), |
73 | .BR isinfl (): | |
63349ee5 | 74 | .RS 4 |
cc4615cc | 75 | _BSD_SOURCE || _SVID_SOURCE |
63349ee5 | 76 | .RE |
7fde78e6 | 77 | .BR isnan (): |
63349ee5 | 78 | .RS 4 |
7fde78e6 | 79 | _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; |
7fde78e6 | 80 | .br |
63349ee5 MK |
81 | or |
82 | .I cc\ -std=c99 | |
83 | .RE | |
cc4615cc MK |
84 | .BR isnanf (), |
85 | .BR isnanl (): | |
63349ee5 | 86 | .RS 4 |
7fde78e6 | 87 | _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 |
63349ee5 | 88 | .RE |
cc4615cc | 89 | .ad b |
fea681da MK |
90 | .SH DESCRIPTION |
91 | The | |
e511ffb6 | 92 | .BR finite () |
c6fa0841 MK |
93 | functions return a nonzero value if |
94 | .I x | |
95 | is neither infinite | |
fea681da MK |
96 | nor a "not-a-number" (NaN) value, and 0 otherwise. |
97 | ||
98 | The | |
e511ffb6 | 99 | .BR isnan () |
c6fa0841 MK |
100 | functions return a nonzero value if |
101 | .I x | |
102 | is a NaN value, | |
fea681da MK |
103 | and 0 otherwise. |
104 | ||
105 | The | |
e511ffb6 | 106 | .BR isinf () |
c6fa0841 MK |
107 | functions return 1 if |
108 | .I x | |
109 | is positive infinity, \-1 if | |
110 | .I x | |
6457ee5a | 111 | is negative infinity, and 0 otherwise. |
77aa3ddc PH |
112 | .SH ATTRIBUTES |
113 | .SS Multithreading (see pthreads(7)) | |
114 | The | |
115 | .BR finite (), | |
116 | .BR finitef (), | |
117 | .BR finitel (), | |
118 | .BR isinf (), | |
119 | .BR isinff (), | |
120 | .BR isinfl (), | |
121 | .BR isnan (), | |
122 | .BR isnanf (), | |
123 | and | |
124 | .BR isnanl () | |
125 | functions are thread-safe. | |
19c98696 | 126 | .SH NOTES |
c13182ef MK |
127 | Note that these functions are obsolete. |
128 | C99 defines macros | |
b4e00e78 | 129 | .BR isfinite (), |
efca8360 MK |
130 | .BR isinf (), |
131 | and | |
132 | .BR isnan () | |
133 | (for all types) replacing them. | |
134 | Further note that the C99 | |
135 | .BR isinf () | |
136 | has weaker guarantees on the return value. | |
fea681da MK |
137 | See |
138 | .BR fpclassify (3). | |
139 | .\" | |
140 | .\" finite* not on HP-UX; they exist on Tru64. | |
889829be MK |
141 | .\" .SH HISTORY |
142 | .\" The | |
143 | .\" .BR finite () | |
144 | .\" function occurs in 4.3BSD. | |
b14d4aa5 | 145 | .\" see IEEE.3 in the 4.3BSD manual |
47297adb | 146 | .SH SEE ALSO |
cc4615cc | 147 | .BR fpclassify (3) |