r/cpp • • Jul 29 '26

C++26: Reducing undefined behaviour

https://www.sandordargo.com/blog/2026/07/29/cpp26-reduces-undefined-behaviour
88 Upvotes

48 comments sorted by

View all comments

Show parent comment

2

u/jk-jeon Jul 30 '26

Thanks for the reply.

Your paper does clarify many things. Is it accepted or likely be accepted? I hope it does.

is_iec559 basically just tells you if the type has infinities and NaNs and is in the usual format of sign bit, biased exponent, and mantissa.

Sounds like it's basically useless then. In my opinion there should be a way to detect if float/double corresponds to one of the basic interchange format (of course in the sense of bit representation only, since according to you it's hard to cover operations as well although I think that's very valuable).

Basically every single modern float-string conversion algorithms start/end by converting between the bit representation of a floating point number and its interpretation as an integer. Currently it seems just impossible to write a portable implementation of such algorithms.