isfinite、 、 _finite_finitef

判斷指定的浮點數值是否有限。

語法

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
要測試的浮點值。

傳回值

若 x 是正規、次正規或帶符號的零±0()有限值,則 isfinite 巨集 與 _finite_finitef 和 函數回傳非零值。 若參數是無限或非數(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>

如需相容性詳細資訊,請參閱相容性。

另請參閱

數學與浮點支援
fpclassify
_fpclass、_fpclassf
isinf
isnan、 、 _isnan_isnanf
isnormal