The object representation for floating-point values is implementation defined. However, an implementation that defines the __STDC_IEC_559__
macro shall conform to the IEC 60559 floating-point standard , and uses what is frequently referred to as IEEE 754 floating-point arithmetic [ISO/IEC 9899:2011]. The floating-point object representation used by IEC 60559 is one of the most common floating-point object representations in use today.
...
Do not compare floating-point object representations directly, such as by calling memcmp()
, or its moral equivalents. Instead, the equality operators (==
and !=
) should be used to determine if two floating-point values are equivalent.
...