如何检查浮点数是否为c中的真数?

前端之家收集整理的这篇文章主要介绍了如何检查浮点数是否为c中的真数?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何检查浮点数是否为真数?那就是:它不是无穷大,负无穷大,NaN ……
float f;
???

解决方法

比std :: fpclassify()更简单的是使用 std::isfinite()

Determines if the given floating point number arg has finite value i.e. it is normal,subnormal or zero,but not infinite or NaN.

原文链接:https://www.f2er.com/c/119507.html

猜你在找的C&C++相关文章