-
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
<charconv>: fix from_chars("0.fffffffffffff8p-1022") #934
Conversation
This commit fixes a bug the computation of floating point exponent when the magnitude of the result before rounding is <= 0.5 ulp smaller than numeric_limits<T>::min(), and after rounding it becomes a normal number.
Side note: It appears to me that |
Current status: after the US holiday this weekend, I'll need to work on a bit of spaceship stuff to unblock other maintainers, then I should have time to review this (which is mostly a matter of exploring how the fix works and getting my brain to catch up - if I had written this part from scratch I would understand it immediately). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, including the set of test cases. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really hope we never lose the comments in <charconv>
.
Thanks for finding and fixing this correctness bug! This will ship in VS 2019 16.8 Preview 3. 😸 |
This PR fixes a bug in the computation of floating point exponent for a special case in
from_chars
, when the magnitude of the result before rounding is <= 0.5 ulp smaller thannumeric_limits<T>::min()
, and after rounding it becomes a normal number.Fixes #931