isinf

确定某个浮点值是否为无穷值。

语法

int isinf(
   /* floating-point */ x
); /* C-only macro */

template <class FloatingType>
inline bool isinf(
   FloatingType x
) throw(); /* C++-only template function */

参数

x
要测试的浮点值。

返回值

如果自变量 x 为正或负无穷大,则 isinf 返回非零值(在 C++ 代码中返回 true)。 如果自变量为有限或 NAN,则 isinf 返回 0(在 C++ 代码中为 false)。 正常和次正常浮点值都会被视为有限。

注解

isinf 在编译为 C 时是宏,在编译为 C++ 时是内联模板函数。

要求

函数 必需的标头 (C) 必需的标头 (C++)
isinf <math.h> <math.h> 或 <cmath>

有关兼容性的详细信息,请参阅 兼容性

另请参阅

数学和浮点支持
fpclassify
_fpclass_fpclassf
isfinite_finite_finitef
isnan_isnan_isnanf
isnormal