Search code examples
c++floating-pointinfinity

Are C++ floats guaranteed to have infinity?


In standards compliant C++, is the following guaranteed to be true?

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

Solution

  • 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)?