开发者

Are C++ floats guaranteed to have infinity?

开发者 https://www.devze.com 2023-03-05 19:22 出处:网络
In standards compliant C++, is the following guaranteed to b开发者_JAVA百科e true? #include <limits>

In standards compliant C++, is the following guaranteed to b开发者_JAVA百科e true?

#include <limits>
std::numeric_limits<float>::has_infinity


I'm no expert, but doesn't that depend on the value of is_iec559, (Tests if a type conforms to IEC-559 / IEEE-754 standard)?


It should, assuming that your library implementation follows the C++ standards and uses a float that has an infinity.

0

精彩评论

暂无评论...
验证码 换一张
取 消