#include <math.h> double nan(const char *tagp); float nanf(const char *tagp); long double nanl(const char *tagp);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
nan(), nanf(), nanl():
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
nan("char-sequence") を呼び出すのは、以下と等価である。
strtod("NAN(char-sequence)", NULL);
同様に、 nanf() や nanl() を呼び出すのは、 strtof() や strtold() を呼ぶのと同じである。
引数 tagp の使い方は規定されていない。 IEEE 754 準拠のシステムでは、NaN にも複数の表現が存在し、 tagp はその選択に使用される。 他のシステムでは、何の意味もないかもしれない。
| インターフェース | 属性 | 値 |
| nan(), nanf(), nanl() | Thread safety | MT-Safe locale |
See also IEC 559 and the appendix with recommended functions in IEEE 754/IEEE 854.