nanのヘルプ・マニュアル
日本語 英語
nan --help
man nan
NAN(3) Linux Programmer’s Manual NAN(3)
名前
nan, nanf, nanl - 無効値 (’Not a Number’) を返す
書式
#include
double nan(const char *tagp);
float nanf(const char *tagp);
long double nanl(const char *tagp);
-lm でリンクする。
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
nan(), nanf(), nanl(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or
cc -std=c99
説明
これらの関数は、SIGFPE シグナルなしの無効値 (NaN) を示す表現を返す ( ど
の表現を使用するかは tagp で指定する)。SIGFPE シグナルなしの NaN をサポ
ートしていない実装では 0 を返す。
nan("char-sequence") を呼び出すのは、
strtod("NAN(char-sequence)", NULL);
と等価である。
同様に、 nanf() や nanl() を呼び出すのは、 strtof() や strtold() を呼ぶ
のと同じである。
引 き 数 tagp の使い方は規定されていない。 IEEE 754 準拠のシステムでは
、NaN にも複数の表現が存在し、 tagp はその選択に使用される。他のシス テ
ムでは、何の意味もないかもしれない。
バージョン
これらの関数は glibc バージョン 2.1 で初めて登場した。
準拠
C99, POSIX.1-2001. IEC 559 や推奨関数になっている IEEE 754/IEEE 854 の
付録も参照すること。
関連項目
isnan(3), strtod(3), math_error(7)
GNU 2008-08-11 NAN(3)
NAN(3) Linux Programmer’s Manual NAN(3)
NAME
nan, nanf, nanl - return ’Not a Number’
SYNOPSIS
#include
double nan(const char *tagp);
float nanf(const char *tagp);
long double nanl(const char *tagp);
Link with -lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
nan(), nanf(), nanl(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or
cc -std=c99
DESCRIPTION
These functions return a representation (determined by tagp) of a quiet
NaN. If the implementation does not support quiet NaNs, these func-
tions return zero.
The call nan("char-sequence") is equivalent to:
strtod("NAN(char-sequence)", NULL);
Similarly, calls to nanf() and nanl() are equivalent to analogous calls
to strtof(3) and strtold(3).
The argument tagp is used in an unspecified manner. On IEEE 754 sys-
tems, there are many representations of NaN, and tagp selects one. On
other systems it may do nothing.
VERSIONS
These functions first appeared in glibc in version 2.1.
CONFORMING TO
C99, POSIX.1-2001. See also IEC 559 and the appendix with recommended
functions in IEEE 754/IEEE 854.
SEE ALSO
isnan(3), strtod(3), math_error(7)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2008-08-11 NAN(3)