boostorg / boostorg/charconv

Rounding in parser doesn't work/is not used

Open
#244 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
32
Forks
29
PR merge metrics
No merged PRs in 30d

Description

The code to check for rounding isn't tested: https://github.com/boostorg/charconv/blob/8fbdb8a08bf0d926b61dfdfea2872f019c8d3608/include/boost/charconv/detail/parser.hpp#L314-L326

I guess the initial idea was:

- Use a buffer 1 **larger** than the max significant digits (see also https://github.com/boostorg/charconv/pull/243)
- If the buffer was full i.e. `offset == significand_buffer_size` (can it ever be greater?) use the last digit for rounding

This IMO needs an additional overflow check in the rounding (the `+=1`)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.