share/mk/: Fix includes
[man-pages.git] / man3 / nan.3
blobf0e79b63deda7e153202b204cd036773afc079ee
1 '\" t
2 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\"
4 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\"
6 .\" Based on glibc infopages
7 .\"
8 .\" Corrections by aeb
9 .\"
10 .TH nan 3 (date) "Linux man-pages (unreleased)"
11 .SH NAME
12 nan, nanf, nanl \- return 'Not a Number'
13 .SH LIBRARY
14 Math library
15 .RI ( libm ", " \-lm )
16 .SH SYNOPSIS
17 .nf
18 .B #include <math.h>
20 .BI "double nan(const char *" tagp );
21 .BI "float nanf(const char *" tagp );
22 .BI "long double nanl(const char *" tagp );
23 .fi
25 .RS -4
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
28 .RE
30 .BR nan (),
31 .BR nanf (),
32 .BR nanl ():
33 .nf
34     _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
35 .fi
36 .SH DESCRIPTION
37 These functions return a representation (determined by
38 .IR tagp )
39 of a quiet NaN.
40 If the implementation does not support
41 quiet NaNs, these functions return zero.
43 The call
44 .I nan("char\-sequence")
45 is equivalent to:
47 .in +4n
48 .EX
49 strtod("NAN(char\-sequence)", NULL);
50 .EE
51 .in
53 Similarly, calls to
54 .BR nanf ()
55 and
56 .BR nanl ()
57 are equivalent to analogous calls to
58 .BR strtof (3)
59 and
60 .BR strtold (3).
62 The argument
63 .I tagp
64 is used in an unspecified manner.
65 On IEEE 754 systems, there are many representations of NaN, and
66 .I tagp
67 selects one.
68 On other systems it may do nothing.
69 .SH ATTRIBUTES
70 For an explanation of the terms used in this section, see
71 .BR attributes (7).
72 .TS
73 allbox;
74 lbx lb lb
75 l l l.
76 Interface       Attribute       Value
78 .na
79 .nh
80 .BR nan (),
81 .BR nanf (),
82 .BR nanl ()
83 T}      Thread safety   MT-Safe locale
84 .TE
85 .SH STANDARDS
86 C11, POSIX.1-2008.
88 See also IEC 559 and the appendix with
89 recommended functions in IEEE 754/IEEE 854.
90 .SH HISTORY
91 glibc 2.1.
92 C99, POSIX.1-2001.
93 .SH SEE ALSO
94 .BR isnan (3),
95 .BR strtod (3),
96 .BR math_error (7)