1NAN(3)                     Linux Programmer's Manual                    NAN(3)
2
3
4

NAME

6       nan, nanf, nanl - return 'Not a Number'
7

SYNOPSIS

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

DESCRIPTION

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

VERSIONS

39       These functions first appeared in glibc in version 2.1.
40

ATTRIBUTES

42       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
43       tributes(7).
44
45       ┌─────────────────────────────────────┬───────────────┬────────────────┐
46Interface                            Attribute     Value          
47       ├─────────────────────────────────────┼───────────────┼────────────────┤
48nan(), nanf(), nanl()                │ Thread safety │ MT-Safe locale │
49       └─────────────────────────────────────┴───────────────┴────────────────┘
50

CONFORMING TO

52       C99,  POSIX.1-2001,  POSIX.1-2008.   See  also IEC 559 and the appendix
53       with recommended functions in IEEE 754/IEEE 854.
54

SEE ALSO

56       isnan(3), strtod(3), math_error(7)
57

COLOPHON

59       This page is part of release 5.12 of the Linux  man-pages  project.   A
60       description  of  the project, information about reporting bugs, and the
61       latest    version    of    this    page,    can     be     found     at
62       https://www.kernel.org/doc/man-pages/.
63
64
65
66GNU                               2021-03-22                            NAN(3)
Impressum