isnormal

确定浮点值是否为正常值。

语法

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

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

参数

x
要测试的浮点值。

返回值

如果自变量 x 不是零、非正常、无限或 NaN,则 isnormal 返回非零值(在 C++ 代码中为 true)。 否则,isnormal 返回 0(在 C++ 代码中为 false)。

注解

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

要求

功能 必需的标头 (C) 必需的标头 (C++)
isnormal <math.h> <math.h> 或 <cmath>

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

另请参阅

数学和浮点支持
isfinite_finite_finitef
isinf
isnan_isnan_isnanf
_fpclass_fpclassf