std::from_chars limitation

Mathieu Malaterre mathieu.malaterre@gmail.com
Thu Jun 19 09:33:07 GMT 2025


Dear all,

I am reading the following note taken from url (*)

[...]
The guarantee that std::from_chars can recover every floating-point
value formatted by std::to_chars exactly is only provided if both
functions are from the same implementation.
[...]

Could some gurus please confirm my understanding of the above note for
*finite* and/or *normal* numbers (not interested in the special
nan/inf case) ?

My understanding is that: GCC and MSVC may output a different ASCII
text given the same inupt floating-point value (bitwise identical).

Using google/chatgpt I could not find one such number.

Thanks,

(*) https://en.cppreference.com/w/cpp/utility/to_chars.html
-- 
Mathieu


More information about the Gcc-help mailing list