.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" Distributed under GPL, 2002-07-27 Walter Harms .\" This was done with the help of the glibc manual. .\" .\" 2004-10-31, aeb, corrected .\" .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO .\" all rights reserved. .\" Translated 2004-07-27, Yuichi SATO .\" Updated & Modified 2005-01-10, Yuichi SATO .\" Updated & Modified 2005-09-04, Akihiro MOTOKI .\" Updated 2008-09-16, Akihiro MOTOKI .\" .TH FPCLASSIFY 3 2010-09-20 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O fpclassify, isfinite, isnormal, isnan, isinf \- floating-point .\"O classification macros fpclassify, isfinite, isnormal, isnan, isinf \- 浮動小数点数の分類マクロ .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "int fpclassify(" x ); .sp .BI "int isfinite(" x ); .sp .BI "int isnormal(" x ); .sp .BI "int isnan(" x ); .sp .BI "int isinf(" x ); .fi .sp .\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .\" I haven't fully grokked the source to determine the FTM requirements; .\" in part, the following has been tested by experiment. .ad l .BR fpclassify (), .BR isfinite (), .BR isnormal (): .RS 4 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or .I cc\ -std=c99 .RE .BR isnan (): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or .I cc\ -std=c99 .RE .BR isinf (): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or .I cc\ -std=c99 .RE .ad .\"O .SH DESCRIPTION .SH 説明 .\"O Floating point numbers can have special values, such as .\"O infinite or NaN. .\"O With the macro .\"O .BI fpclassify( x ) .\"O you can find out what type .\"O .I x .\"O is. .\"O The macro takes any floating-point expression as argument. 浮動小数点数は無限大や NaN のような特別な値を持つことができる。 マクロ .BI fpclassify( x ) で .I x がどのような種別かを知ることができる。 マクロは任意の浮動小数点数表現を引き数としてとることができる。 .\"O The result is one of the following values: 結果は以下の値のいずれか一つである: .TP 14 .B FP_NAN .\"O .I x .\"O is "Not a Number". .I x が "Not a Number" である (数値ではない)。 .TP .B FP_INFINITE .\"O .I x .\"O is either positive infinity or negative infinity. .I x が正の無限大または負の無限大である。 .TP .B FP_ZERO .\"O .I x .\"O is zero. .I x が 0 である。 .TP .B FP_SUBNORMAL .\"O .I x .\"O is too small to be represented in normalized format. .I x を正規化形式で表現するには小さすぎる。 .TP .B FP_NORMAL .\"O if nothing of the above is correct then it must be a .\"O normal floating-point number. 上記のどれにも当てはまらない場合であり、 値は通常の浮動小数点数であるはずだ。 .LP .\"O The other macros provide a short answer to some standard questions. 他のマクロは、いくつかの標準的な問いに対して、簡単な答えを提供する。 .TP 14 .BI isfinite( x ) .\"O returns a nonzero value if .\"O .br .\"O (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE) (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE) の場合に 0 以外の値を返す。 .TP .BI isnormal( x ) .\"O returns a nonzero value if .\"O (fpclassify(x) == FP_NORMAL) (fpclassify(x) == FP_NORMAL) の場合に 0 以外の値を返す。 .TP .BI isnan( x ) .\"O returns a nonzero value if .\"O (fpclassify(x) == FP_NAN) (fpclassify(x) == FP_NAN) の場合に 0 以外の値を返す。 .TP .BI isinf( x ) .\"O returns 1 if .\"O .I x .\"O is positive infinity, and \-1 if .\"O .I x .\"O is negative infinity. .I x が正の無限大の場合は 1 を、 負の無限大の場合は \-1 を返す。 .\"O .SH "CONFORMING TO" .SH 準拠 C99, POSIX.1. .\"O For .\"O .BR isinf (), .\"O the standards merely say that the return value is nonzero .\"O if and only if the argument has an infinite value. .BR isinf () に関して、標準規格で定められているのは、 返り値が 0 以外になるのは引き数が無限大の場合だけということだけである。 .\"O .SH NOTES .SH 注意 .\"O In glibc 2.01 and earlier, .\"O .BR isinf () .\"O returns a nonzero value (actually: 1) if .\"O .I x .\"O is positive infinity or negative infinity. .\"O (This is all that C99 requires.) glibc 2.01 以前では、 .BR isinf () は .I x が正の無限大か負の無限大の場合、 0 以外の値 (実際には 1) を返す (C99 の要求仕様で決まっているのは 0 以外の値を返すということだけである)。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR finite (3), .BR INFINITY (3), .BR isgreater (3), .BR signbit (3)