mount_setattr.2: Minor tweaks to Christian's patch
[man-pages.git] / man3 / finite.3
bloba255f3624df3dec67ae2f7c5a28a899740b5a629
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  2021-03-22 "" "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 .BI "int finitef(float " x );
35 .BI "int finitel(long double " x );
36 .PP
37 .BI "int isinf(double " x );
38 .BI "int isinff(float " x );
39 .BI "int isinfl(long double " x );
40 .PP
41 .BI "int isnan(double " x );
42 .BI "int isnanf(float " x );
43 .BI "int isnanl(long double " x );
44 .fi
45 .PP
46 .RS -4
47 Feature Test Macro Requirements for glibc (see
48 .BR feature_test_macros (7)):
49 .RE
50 .PP
51 .BR finite (),
52 .BR finitef (),
53 .BR finitel ():
54 .nf
55     /* Glibc since 2.19: */ _DEFAULT_SOURCE
56         || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
57 .PP
58 .BR isinf ():
59     _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE
60         || /* Glibc since 2.19: */ _DEFAULT_SOURCE
61         || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
62 .fi
63 .PP
64 .BR isinff (),
65 .BR isinfl ():
66 .nf
67     /* Glibc since 2.19: */ _DEFAULT_SOURCE
68         || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
69 .fi
70 .PP
71 .BR isnan ():
72 .nf
73     _XOPEN_SOURCE || _ISOC99_SOURCE
74         || /* Glibc since 2.19: */ _DEFAULT_SOURCE
75         || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
76 .fi
77 .PP
78 .BR isnanf (),
79 .BR isnanl ():
80 .nf
81     _XOPEN_SOURCE >= 600
82         || /* Glibc since 2.19: */ _DEFAULT_SOURCE
83         || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
84 .fi
85 .SH DESCRIPTION
86 The
87 .BR finite (),
88 .BR finitef (),
89 and
90 .BR finitel ()
91 functions return a nonzero value if
92 .I x
93 is neither infinite
94 nor a "not-a-number" (NaN) value, and 0 otherwise.
95 .PP
96 The
97 .BR isnan (),
98 .BR isnanf (),
99 and
100 .BR isnanl ()
101 functions return a nonzero value if
102 .I x
103 is a NaN value,
104 and 0 otherwise.
107 .BR isinf (),
108 .BR isinff (),
110 .BR isinfl ()
111 functions return 1 if
112 .I x
113 is positive infinity, \-1 if
114 .I x
115 is negative infinity, and 0 otherwise.
116 .SH ATTRIBUTES
117 For an explanation of the terms used in this section, see
118 .BR attributes (7).
119 .ad l
122 allbox;
123 lbx lb lb
124 l l l.
125 Interface       Attribute       Value
127 .BR finite (),
128 .BR finitef (),
129 .BR finitel (),
130 .BR isinf (),
131 .BR isinff (),
132 .BR isinfl (),
133 .BR isnan (),
134 .BR isnanf (),
135 .BR isnanl ()
136 T}      Thread safety   MT-Safe
140 .sp 1
141 .SH NOTES
142 Note that these functions are obsolete.
143 C99 defines macros
144 .BR isfinite (),
145 .BR isinf (),
147 .BR isnan ()
148 (for all types) replacing them.
149 Further note that the C99
150 .BR isinf ()
151 has weaker guarantees on the return value.
153 .BR fpclassify (3).
155 .\" finite* not on HP-UX; they exist on Tru64.
156 .\" .SH HISTORY
157 .\" The
158 .\" .BR finite ()
159 .\" function occurs in 4.3BSD.
160 .\" see IEEE.3 in the 4.3BSD manual
161 .SH SEE ALSO
162 .BR fpclassify (3)