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
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈