]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/finite.3
CPU_SET.3, INFINITY.3, __ppc_get_timebase.3, __ppc_set_ppr_med.3, __ppc_yield.3,...
[thirdparty/man-pages.git] / man3 / finite.3
1 .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
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.
12 .\"
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.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .TH FINITE 3 2016-03-15 "" "Linux Programmer's Manual"
26 .SH NAME
27 finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl \-
28 BSD floating-point classification functions
29 .SH SYNOPSIS
30 .nf
31 .B #include <math.h>
32 .PP
33 .BI "int finite(double " x );
34 .br
35 .BI "int finitef(float " x );
36 .br
37 .BI "int finitel(long double " x );
38 .PP
39 .BI "int isinf(double " x );
40 .br
41 .BI "int isinff(float " x );
42 .br
43 .BI "int isinfl(long double " x );
44 .PP
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
51 .PP
52 .in -4n
53 Feature Test Macro Requirements for glibc (see
54 .BR feature_test_macros (7)):
55 .in
56 .PP
57 .ad l
58 .BR finite (),
59 .BR finitef (),
60 .BR finitel ():
61 .RS 4
62 /* Glibc since 2.19: */ _DEFAULT_SOURCE
63 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
64 .RE
65 .BR isinf ():
66 .RS 4
67 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE
68 || /* Glibc since 2.19: */ _DEFAULT_SOURCE
69 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
70 .RE
71 .br
72 .BR isinff (),
73 .BR isinfl ():
74 .RS 4
75 /* Glibc since 2.19: */ _DEFAULT_SOURCE
76 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
77 .RE
78 .BR isnan ():
79 .RS 4
80 _XOPEN_SOURCE || _ISOC99_SOURCE
81 || /* Glibc since 2.19: */ _DEFAULT_SOURCE
82 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
83 .RE
84 .BR isnanf (),
85 .BR isnanl ():
86 .RS 4
87 _XOPEN_SOURCE\ >=\ 600
88 || /* Glibc since 2.19: */ _DEFAULT_SOURCE
89 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
90 .RE
91 .ad b
92 .SH DESCRIPTION
93 The
94 .BR finite (),
95 .BR finitef (),
96 and
97 .BR finitel ()
98 functions return a nonzero value if
99 .I x
100 is neither infinite
101 nor a "not-a-number" (NaN) value, and 0 otherwise.
102 .PP
103 The
104 .BR isnan (),
105 .BR isnanf (),
106 and
107 .BR isnanl ()
108 functions return a nonzero value if
109 .I x
110 is a NaN value,
111 and 0 otherwise.
112 .PP
113 The
114 .BR isinf (),
115 .BR isinff (),
116 and
117 .BR isinfl ()
118 functions return 1 if
119 .I x
120 is positive infinity, \-1 if
121 .I x
122 is negative infinity, and 0 otherwise.
123 .SH ATTRIBUTES
124 For an explanation of the terms used in this section, see
125 .BR attributes (7).
126 .TS
127 allbox;
128 lbw31 lb lb
129 l l l.
130 Interface Attribute Value
131 T{
132 .BR finite (),
133 .BR finitef (),
134 .BR finitel (),
135 .br
136 .BR isinf (),
137 .BR isinff (),
138 .BR isinfl (),
139 .br
140 .BR isnan (),
141 .BR isnanf (),
142 .BR isnanl ()
143 T} Thread safety MT-Safe
144 .TE
145 .SH NOTES
146 Note that these functions are obsolete.
147 C99 defines macros
148 .BR isfinite (),
149 .BR isinf (),
150 and
151 .BR isnan ()
152 (for all types) replacing them.
153 Further note that the C99
154 .BR isinf ()
155 has weaker guarantees on the return value.
156 See
157 .BR fpclassify (3).
158 .\"
159 .\" finite* not on HP-UX; they exist on Tru64.
160 .\" .SH HISTORY
161 .\" The
162 .\" .BR finite ()
163 .\" function occurs in 4.3BSD.
164 .\" see IEEE.3 in the 4.3BSD manual
165 .SH SEE ALSO
166 .BR fpclassify (3)