]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
2297bf0e | 2 | .\" |
38f20bb9 | 3 | .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) |
fea681da | 4 | .\" Distributed under GPL |
38f20bb9 | 5 | .\" %%%LICENSE_END |
51f2944d | 6 | .\" |
fea681da MK |
7 | .\" Based on glibc infopages |
8 | .\" | |
9 | .\" Corrections by aeb | |
51f2944d | 10 | .\" |
97986708 | 11 | .TH NAN 3 2016-03-15 "GNU" "Linux Programmer's Manual" |
fea681da MK |
12 | .SH NAME |
13 | nan, nanf, nanl \- return 'Not a Number' | |
14 | .SH SYNOPSIS | |
15 | .B #include <math.h> | |
68e4db0a | 16 | .PP |
fea681da | 17 | .BI "double nan(const char *" tagp ); |
d39541ec | 18 | .br |
fea681da | 19 | .BI "float nanf(const char *" tagp ); |
d39541ec | 20 | .br |
fea681da | 21 | .BI "long double nanl(const char *" tagp ); |
68e4db0a | 22 | .PP |
d39e8d56 | 23 | Link with \fI\-lm\fP. |
68e4db0a | 24 | .PP |
cc4615cc MK |
25 | .in -4n |
26 | Feature Test Macro Requirements for glibc (see | |
27 | .BR feature_test_macros (7)): | |
28 | .in | |
68e4db0a | 29 | .PP |
5146e1d4 | 30 | .ad l |
cc4615cc | 31 | .BR nan (), |
e0bf9127 | 32 | .BR nanf (), |
cc4615cc | 33 | .BR nanl (): |
21135fb3 | 34 | .RS 4 |
e464f054 | 35 | _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L |
21135fb3 | 36 | .RE |
5146e1d4 | 37 | .ad |
fea681da MK |
38 | .SH DESCRIPTION |
39 | These functions return a representation (determined by | |
40 | .IR tagp ) | |
1c44bd5b MK |
41 | of a quiet NaN. |
42 | If the implementation does not support | |
fea681da | 43 | quiet NaNs, these functions return zero. |
dd3568a1 | 44 | .PP |
fea681da MK |
45 | The call |
46 | .I nan("char-sequence") | |
5584a528 | 47 | is equivalent to: |
207050fa | 48 | .PP |
408731d4 MK |
49 | .in +4n |
50 | .EX | |
51 | strtod("NAN(char-sequence)", NULL); | |
52 | .EE | |
53 | .in | |
5584a528 MK |
54 | .PP |
55 | Similarly, calls to | |
31e9a9ec | 56 | .BR nanf () |
fea681da | 57 | and |
31e9a9ec | 58 | .BR nanl () |
fea681da | 59 | are equivalent to analogous calls to |
fb186734 | 60 | .BR strtof (3) |
fea681da | 61 | and |
fb186734 | 62 | .BR strtold (3). |
fea681da MK |
63 | .PP |
64 | The argument | |
65 | .I tagp | |
c13182ef MK |
66 | is used in an unspecified manner. |
67 | On IEEE 754 systems, there are many representations of NaN, and | |
fea681da | 68 | .I tagp |
c13182ef MK |
69 | selects one. |
70 | On other systems it may do nothing. | |
f0d7ce1d MK |
71 | .SH VERSIONS |
72 | These functions first appeared in glibc in version 2.1. | |
09176079 MS |
73 | .SH ATTRIBUTES |
74 | For an explanation of the terms used in this section, see | |
75 | .BR attributes (7). | |
76 | .TS | |
77 | allbox; | |
081a3b21 | 78 | lbw21 lb lb |
09176079 MS |
79 | l l l. |
80 | Interface Attribute Value | |
81 | T{ | |
82 | .BR nan (), | |
83 | .BR nanf (), | |
84 | .BR nanl () | |
85 | T} Thread safety MT-Safe locale | |
86 | .TE | |
47297adb | 87 | .SH CONFORMING TO |
9a74e018 | 88 | C99, POSIX.1-2001, POSIX.1-2008. |
1c44bd5b | 89 | See also IEC 559 and the appendix with |
fea681da | 90 | recommended functions in IEEE 754/IEEE 854. |
47297adb | 91 | .SH SEE ALSO |
fea681da | 92 | .BR isnan (3), |
d39e8d56 MK |
93 | .BR strtod (3), |
94 | .BR math_error (7) |