]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
2 | .\" Distributed under GPL | |
3 | .\" Based on glibc infopages | |
4 | .\" | |
5 | .\" Corrections by aeb | |
f0d7ce1d | 6 | .TH NAN 3 2008-08-11 "GNU" "Linux Programmer's Manual" |
fea681da MK |
7 | .SH NAME |
8 | nan, nanf, nanl \- return 'Not a Number' | |
9 | .SH SYNOPSIS | |
10 | .B #include <math.h> | |
11 | .sp | |
12 | .BI "double nan(const char *" tagp ); | |
d39541ec | 13 | .br |
fea681da | 14 | .BI "float nanf(const char *" tagp ); |
d39541ec | 15 | .br |
fea681da MK |
16 | .BI "long double nanl(const char *" tagp ); |
17 | .sp | |
d39e8d56 | 18 | Link with \fI\-lm\fP. |
cc4615cc MK |
19 | .sp |
20 | .in -4n | |
21 | Feature Test Macro Requirements for glibc (see | |
22 | .BR feature_test_macros (7)): | |
23 | .in | |
24 | .sp | |
25 | .BR nan (), | |
e0bf9127 | 26 | .BR nanf (), |
cc4615cc | 27 | .BR nanl (): |
21135fb3 MK |
28 | .RS 4 |
29 | _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; | |
30 | .br | |
31 | or | |
cc4615cc | 32 | .I cc\ -std=c99 |
21135fb3 | 33 | .RE |
fea681da MK |
34 | .SH DESCRIPTION |
35 | These functions return a representation (determined by | |
36 | .IR tagp ) | |
1c44bd5b MK |
37 | of a quiet NaN. |
38 | If the implementation does not support | |
fea681da MK |
39 | quiet NaNs, these functions return zero. |
40 | .LP | |
41 | The call | |
42 | .I nan("char-sequence") | |
5584a528 MK |
43 | is equivalent to: |
44 | .nf | |
45 | ||
46 | strtod("NAN(char-sequence)", NULL); | |
47 | .fi | |
48 | .PP | |
49 | Similarly, calls to | |
31e9a9ec | 50 | .BR nanf () |
fea681da | 51 | and |
31e9a9ec | 52 | .BR nanl () |
fea681da | 53 | are equivalent to analogous calls to |
fb186734 | 54 | .BR strtof (3) |
fea681da | 55 | and |
fb186734 | 56 | .BR strtold (3). |
fea681da MK |
57 | .PP |
58 | The argument | |
59 | .I tagp | |
c13182ef MK |
60 | is used in an unspecified manner. |
61 | On IEEE 754 systems, there are many representations of NaN, and | |
fea681da | 62 | .I tagp |
c13182ef MK |
63 | selects one. |
64 | On other systems it may do nothing. | |
f0d7ce1d MK |
65 | .SH VERSIONS |
66 | These functions first appeared in glibc in version 2.1. | |
fea681da | 67 | .SH "CONFORMING TO" |
cfe08d1e | 68 | C99, POSIX.1-2001. |
1c44bd5b | 69 | See also IEC 559 and the appendix with |
fea681da MK |
70 | recommended functions in IEEE 754/IEEE 854. |
71 | .SH "SEE ALSO" | |
72 | .BR isnan (3), | |
d39e8d56 MK |
73 | .BR strtod (3), |
74 | .BR math_error (7) |