]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/nan.3
5ea72612d12459dac038e93f0b3301ca37f7c577
[thirdparty/man-pages.git] / man3 / nan.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .\" Based on glibc infopages
8 .\"
9 .\" Corrections by aeb
10 .\"
11 .TH NAN 3 2015-04-19 "GNU" "Linux Programmer's Manual"
12 .SH NAME
13 nan, nanf, nanl \- return 'Not a Number'
14 .SH SYNOPSIS
15 .B #include <math.h>
16 .sp
17 .BI "double nan(const char *" tagp );
18 .br
19 .BI "float nanf(const char *" tagp );
20 .br
21 .BI "long double nanl(const char *" tagp );
22 .sp
23 Link with \fI\-lm\fP.
24 .sp
25 .in -4n
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
28 .in
29 .sp
30 .ad l
31 .BR nan (),
32 .BR nanf (),
33 .BR nanl ():
34 .RS 4
35 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
36 _POSIX_C_SOURCE\ >=\ 200112L;
37 .br
38 or
39 .I cc\ -std=c99
40 .RE
41 .ad
42 .SH DESCRIPTION
43 These functions return a representation (determined by
44 .IR tagp )
45 of a quiet NaN.
46 If the implementation does not support
47 quiet NaNs, these functions return zero.
48 .LP
49 The call
50 .I nan("char-sequence")
51 is equivalent to:
52 .nf
53
54 strtod("NAN(char-sequence)", NULL);
55 .fi
56 .PP
57 Similarly, calls to
58 .BR nanf ()
59 and
60 .BR nanl ()
61 are equivalent to analogous calls to
62 .BR strtof (3)
63 and
64 .BR strtold (3).
65 .PP
66 The argument
67 .I tagp
68 is used in an unspecified manner.
69 On IEEE 754 systems, there are many representations of NaN, and
70 .I tagp
71 selects one.
72 On other systems it may do nothing.
73 .SH VERSIONS
74 These functions first appeared in glibc in version 2.1.
75 .SH ATTRIBUTES
76 For an explanation of the terms used in this section, see
77 .BR attributes (7).
78 .TS
79 allbox;
80 lbw21 lb lb
81 l l l.
82 Interface Attribute Value
83 T{
84 .BR nan (),
85 .BR nanf (),
86 .BR nanl ()
87 T} Thread safety MT-Safe locale
88 .TE
89 .SH CONFORMING TO
90 C99, POSIX.1-2001, POSIX.1-2008.
91 See also IEC 559 and the appendix with
92 recommended functions in IEEE 754/IEEE 854.
93 .SH SEE ALSO
94 .BR isnan (3),
95 .BR strtod (3),
96 .BR math_error (7)