r/cpp • u/pavel_v • Jul 29 '26
C++26: Reducing undefined behaviour
https://www.sandordargo.com/blog/2026/07/29/cpp26-reduces-undefined-behaviour
89
Upvotes
r/cpp • u/pavel_v • Jul 29 '26
View all comments
Show parent comment
3
u/eisenwave WG21 Member Jul 30 '26
is_iec559only tells you about the representation of the type and nothing about what its operations do. P3938R1 clarifies this, but it's already clear to the committee that this is the case at least.I think
-ffast-matchis just a non-compliant extension.No, there is no real way to detect if the type is in binary32 representation. It could be in a binary16 and have 16 padding bits, or it could be an extended precision floating-point format, which is also specified in ISO/IEC 60559, but is not a binary interchange format.
is_iec559basically just tells you if the type has infinities and NaNs and is in the usual format of sign bit, biased exponent, and mantissa.