Are C++ floats guaranteed to have infinity?
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.
精彩评论