C++ Implementation-defined behavior Value representation of floating point types

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

The standard requires that long double provides at least as much precision as double, which provides at least as much precision as float; and that a long double can represent any value that a double can represent, while a double can represent any value that a float can represent. The details of the representation are, however, implementation-defined.

For a floating point type T, std::numeric_limits<T>::radix specifies the radix used by the representation of T.

If std::numeric_limits<T>::is_iec559 is true, then the representation of T matches one of the formats defined by IEC 559 / IEEE 754.



Got any C++ Question?