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