判斷浮點值是否為無限大。
語法
int isinf(
/* floating-point */ x
); /* C-only macro */
template <class FloatingType>
inline bool isinf(
FloatingType x
) throw(); /* C++-only template function */
參數
x
要測試的浮點值。
傳回值
isinf如果自變數x為正數或負無限大,則傳回非零值 (true在 C++ 程式代碼中)。 isinf 如果自變數是有限或 NAN,則會傳回 0 (false 在C++程式代碼中)。 一般和次正規浮點值都會被視為有限。
備註
isinf 當編譯為 C 時,是巨集,當編譯為 C++ 時為內嵌範本函式。
需求
| 函式 | 必要的標頭 (C) | 必要的標頭 (C++) |
|---|---|---|
isinf |
<math.h> | <math.h> 或 <cmath> |
如需相容性詳細資訊,請參閱相容性。
另請參閱
數學與浮點支援
fpclassify
_fpclass, _fpclassf
isfinite、 、 _finite_finitef
isnan、 、 _isnan_isnanf
isnormal