You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally I think it doesn't even do what it should:
The parser interface seems to be used only for (some) long double and by from_chars_float_impl if the format is "hex"
for the latter the rounding doesn't make sense as the significant buffer is sized for base 10 so if that is full, with base 16 the value will be too large returning an out-of-range later
for the long double case (which is only used on some platforms, e.g. not for MSVC or if long double == double) the rounding case cannot be entered because i <= significand_buffer_size is ensured by the prior code
That might actually introduce a rounding error violating the specification: E.g. "Rounding" the uint64 significant to double (53bit resolution) where remaining decimal digits are ignored instead of used for round can lead to a different rounding for some values as the rounding to the last digit of the significant might cause a carry to the place used for rounding to double,
The code to check for rounding isn't tested:
charconv/include/boost/charconv/detail/parser.hpp
Lines 314 to 326 in 8fbdb8a
I guess the initial idea was:
offset == significand_buffer_size
(can it ever be greater?) use the last digit for roundingThis IMO needs an additional overflow check in the rounding (the
+=1
)The text was updated successfully, but these errors were encountered: