浮動小数点値が有限かどうかを決定します。
構文
int isfinite(
/* floating-point */ x
); /* C-only macro */
template <class FloatingType>
inline bool isfinite(
FloatingType x
) throw(); /* C++-only template function */
int _finite(
double x
);
int _finitef(
float x
); /* x64 and ARM/ARM64 only */
パラメーター
x
テストする浮動小数点値。
戻り値
isfiniteマクロと_finite関数と_finitef関数は、xが正規、非正規、または符号付きゼロ (±0) の有限値である場合、0 以外の値を返します。 引数が無限または Not a Number (NaN) の場合は 0 を返します。 C++ インライン テンプレート関数 isfinite は同じように動作しますが、 true または falseを返します。
解説
_finiteと_finitefはMicrosoft固有です。
isfinite は C としてコンパイルされる場合はマクロ、C++ としてコンパイルされる場合はインライン テンプレート関数になります。
_finitef は、x64、ARM、ARM64、またはARM64EC プラットフォーム用にコンパイルする場合にのみ使用できます。
要件
| 機能 | 必須ヘッダー (C) | 必須ヘッダー (C++) |
|---|---|---|
isfinite |
<math.h> |
<math.h> または <cmath> |
_finite |
<float.h> |
<float.h> または <cfloat> |
_finitef |
<math.h> |
<math.h> または <cmath> |
互換性の詳細については、「 Compatibility」を参照してください。
関連項目
数値演算と浮動小数点のサポート
fpclassify
_fpclass, _fpclassf
isinf
isnan、 _isnan、 _isnanf
isnormal