Skip to content
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

Avoid negative shift. #42

Merged
merged 2 commits into from
Mar 6, 2017
Merged

Avoid negative shift. #42

merged 2 commits into from
Mar 6, 2017

Conversation

floitschG
Copy link
Contributor

When filling in fractional digits in a fixed representation we
might use all existing digits. When this happens, we can not look
at the next digit to see if we should round up.

Before this fix, we tried to shift by a negative amount to see if the
(non-existing) next bit was set to 1 (requiring the number to be rounded up).

Fixes #41.

When filling in fractional digits in a fixed representation we
might use all existing digits. When this happens, we can not look
at the next digit to see if we should round up.

Before this fix, we tried to shift by a negative amount to see if the
(non-existing) next bit was set to 1 (requiring the number to be rounded up).

Fixes #41.
Copy link

@whesse whesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@floitsch floitsch merged commit 4abe326 into master Mar 6, 2017
@floitsch floitsch deleted the avoid_negative_shift branch May 5, 2019 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UB in FastFixedDtoa
3 participants