The code to check for rounding isn't tested:
|
if (offset > significand_buffer_size) |
|
{ |
|
offset = significand_buffer_size - 1; |
|
i = significand_buffer_size; |
|
if (significand_buffer[offset] == '5' || |
|
significand_buffer[offset] == '6' || |
|
significand_buffer[offset] == '7' || |
|
significand_buffer[offset] == '8' || |
|
significand_buffer[offset] == '9') |
|
{ |
|
round = true; |
|
} |
|
} |
I guess the initial idea was:
This IMO needs an additional overflow check in the rounding (the +=1)
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)