]>
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 | .\" |
a1949252 | 25 | .TH FINITE 3 2008-08-05 "" "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 () |
c7094399 | 93 | functions return a nonzero value if \fIx\fP is neither infinite |
fea681da MK |
94 | nor a "not-a-number" (NaN) value, and 0 otherwise. |
95 | ||
96 | The | |
e511ffb6 | 97 | .BR isnan () |
c7094399 | 98 | functions return a nonzero value if \fIx\fP is a NaN value, |
fea681da MK |
99 | and 0 otherwise. |
100 | ||
101 | The | |
e511ffb6 | 102 | .BR isinf () |
7fde78e6 | 103 | functions return 1 if \fIx\fP is positive infinity, \-1 if \fIx\fP |
6457ee5a | 104 | is negative infinity, and 0 otherwise. |
19c98696 | 105 | .SH NOTES |
c13182ef MK |
106 | Note that these functions are obsolete. |
107 | C99 defines macros | |
b4e00e78 | 108 | .BR isfinite (), |
efca8360 MK |
109 | .BR isinf (), |
110 | and | |
111 | .BR isnan () | |
112 | (for all types) replacing them. | |
113 | Further note that the C99 | |
114 | .BR isinf () | |
115 | has weaker guarantees on the return value. | |
fea681da MK |
116 | See |
117 | .BR fpclassify (3). | |
118 | .\" | |
119 | .\" finite* not on HP-UX; they exist on Tru64. | |
889829be MK |
120 | .\" .SH HISTORY |
121 | .\" The | |
122 | .\" .BR finite () | |
123 | .\" function occurs in 4.3BSD. | |
b14d4aa5 | 124 | .\" see IEEE.3 in the 4.3BSD manual |
47297adb | 125 | .SH SEE ALSO |
cc4615cc | 126 | .BR fpclassify (3) |