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():  _XOPEN_SOURCE >= 600  ||  _ISOC99_SOURCE;  or
20       cc -std=c99
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

CONFORMING TO

42       C99,  POSIX.1-2001.  See also IEC 559 and the appendix with recommended
43       functions in IEEE 754/IEEE 854.
44

SEE ALSO

46       isnan(3), strtod(3), math_error(7)
47

COLOPHON

49       This page is part of release 3.22 of the Linux  man-pages  project.   A
50       description  of  the project, and information about reporting bugs, can
51       be found at http://www.kernel.org/doc/man-pages/.
52
53
54
55GNU                               2008-08-11                            NAN(3)
Impressum