1NAN(3P) POSIX Programmer's Manual NAN(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 nan, nanf, nanl — return quiet NaN
14
16 #include <math.h>
17
18 double nan(const char *tagp);
19 float nanf(const char *tagp);
20 long double nanl(const char *tagp);
21
23 The functionality described on this reference page is aligned with the
24 ISO C standard. Any conflict between the requirements described here
25 and the ISO C standard is unintentional. This volume of POSIX.1‐2008
26 defers to the ISO C standard.
27
28 The function call nan("n-char-sequence") shall be equivalent to:
29
30 strtod("NAN(n-char-sequence)", (char **) NULL);
31
32 The function call nan("") shall be equivalent to:
33
34 strtod("NAN()", (char **) NULL)
35
36 If tagp does not point to an n-char sequence or an empty string, the
37 function call shall be equivalent to:
38
39 strtod("NAN", (char **) NULL)
40
41 Function calls to nanf() and nanl() are equivalent to the corresponding
42 function calls to strtof() and strtold().
43
45 These functions shall return a quiet NaN, if available, with content
46 indicated through tagp.
47
48 If the implementation does not support quiet NaNs, these functions
49 shall return zero.
50
52 No errors are defined.
53
54 The following sections are informative.
55
57 None.
58
60 None.
61
63 None.
64
66 None.
67
69 strtod()
70
71 The Base Definitions volume of POSIX.1‐2008, <math.h>
72
74 Portions of this text are reprinted and reproduced in electronic form
75 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
76 -- Portable Operating System Interface (POSIX), The Open Group Base
77 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
78 cal and Electronics Engineers, Inc and The Open Group. (This is
79 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
80 event of any discrepancy between this version and the original IEEE and
81 The Open Group Standard, the original IEEE and The Open Group Standard
82 is the referee document. The original Standard can be obtained online
83 at http://www.unix.org/online.html .
84
85 Any typographical or formatting errors that appear in this page are
86 most likely to have been introduced during the conversion of the source
87 files to man page format. To report such errors, see https://www.ker‐
88 nel.org/doc/man-pages/reporting_bugs.html .
89
90
91
92IEEE/The Open Group 2013 NAN(3P)