1NAN(3) Linux Programmer's Manual NAN(3)
2
3
4
6 nan, nanf, nanl - return 'Not a Number'
7
9 #include <math.h>
10
11 double nan(const char *tagp);
12 float nanf(const char *tagp);
13 long double nanl(const char *tagp);
14
15 Link with -lm.
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 nan(), nanf(), nanl():
20 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
21
23 These functions return a representation (determined by tagp) of a quiet
24 NaN. If the implementation does not support quiet NaNs, these func‐
25 tions return zero.
26
27 The call nan("char-sequence") is equivalent to:
28
29 strtod("NAN(char-sequence)", NULL);
30
31 Similarly, calls to nanf() and nanl() are equivalent to analogous calls
32 to strtof(3) and strtold(3).
33
34 The argument tagp is used in an unspecified manner. On IEEE 754 sys‐
35 tems, there are many representations of NaN, and tagp selects one. On
36 other systems it may do nothing.
37
39 These functions first appeared in glibc in version 2.1.
40
42 For an explanation of the terms used in this section, see
43 attributes(7).
44
45 ┌──────────────────────┬───────────────┬────────────────┐
46 │Interface │ Attribute │ Value │
47 ├──────────────────────┼───────────────┼────────────────┤
48 │nan(), nanf(), nanl() │ Thread safety │ MT-Safe locale │
49 └──────────────────────┴───────────────┴────────────────┘
51 C99, POSIX.1-2001, POSIX.1-2008. See also IEC 559 and the appendix
52 with recommended functions in IEEE 754/IEEE 854.
53
55 isnan(3), strtod(3), math_error(7)
56
58 This page is part of release 5.07 of the Linux man-pages project. A
59 description of the project, information about reporting bugs, and the
60 latest version of this page, can be found at
61 https://www.kernel.org/doc/man-pages/.
62
63
64
65GNU 2016-03-15 NAN(3)