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           _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE ||
21           _POSIX_C_SOURCE >= 200112L;
22           or cc -std=c99
23

DESCRIPTION

25       These functions return a representation (determined by tagp) of a quiet
26       NaN.   If  the  implementation does not support quiet NaNs, these func‐
27       tions return zero.
28
29       The call nan("char-sequence") is equivalent to:
30
31           strtod("NAN(char-sequence)", NULL);
32
33       Similarly, calls to nanf() and nanl() are equivalent to analogous calls
34       to strtof(3) and strtold(3).
35
36       The  argument  tagp is used in an unspecified manner.  On IEEE 754 sys‐
37       tems, there are many representations of NaN, and tagp selects one.   On
38       other systems it may do nothing.
39

VERSIONS

41       These functions first appeared in glibc in version 2.1.
42

CONFORMING TO

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

SEE ALSO

48       isnan(3), strtod(3), math_error(7)
49

COLOPHON

51       This page is part of release 3.53 of the Linux  man-pages  project.   A
52       description  of  the project, and information about reporting bugs, can
53       be found at http://www.kernel.org/doc/man-pages/.
54
55
56
57GNU                               2010-09-20                            NAN(3)
Impressum