-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<xlocnum>: Incorrect rounding when parsing long hexadecimal floating point numbers just above midpoints #3375
Comments
I think ideally we should determine whether the reperesentation without the "sticky" part is exactly a midpoint. If not so, the "sticky" part should be discarded, otherwise, it should cause "adding one". But such determination might be a heavy work, and lightweight alternatives seem possible. |
When the radix of the number system is even and >= 4, to round a number for rounding again to less significant digits later, possibly with different rounding modes, one of the possible algorithms is to add one if and only if
|
Thank you! I do want to believe this is correct and thus we can drop the carrying logic. |
Co-authored-by: statementreply <statementreply@gmail.com>
Describe the bug
The hexadecimal code path of
num_get::do_get
parses the initial 768 significant digits and discards the remaining. When the remaining digits could affect rounding, it returns an incorrect result.Command-line test case
STL version
The text was updated successfully, but these errors were encountered: