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

[mypyc] Fix division of negative tagged int #11168

Merged
merged 1 commit into from Sep 22, 2021
Merged

[mypyc] Fix division of negative tagged int #11168

merged 1 commit into from Sep 22, 2021

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Sep 22, 2021

The rounding was incorrect for some negative values, because of a bug
related to the tagged integer logic. For example, -5 // 2 evaluated to
-4 instead of -3 (ouch). Change the rounding implementation to not use
shifted integers.

Also add more exhaustive testing and fix a broken integer test case.

The rounding was incorrect for some negative values, because of a bug
related to the tagged integer logic. For example, -5 // 2 evaluated to
-4 instead of -3 (ouch). Change the rounding implementation to not use
shifted integers.

Also add more exhaustive testing and fix a broken integer test case.
@JukkaL JukkaL merged commit 2f2c377 into master Sep 22, 2021
@JukkaL JukkaL deleted the fix-divide branch September 22, 2021 10:31
ilevkivskyi pushed a commit that referenced this pull request Sep 23, 2021
The rounding was incorrect for some negative values, because of a bug
related to the tagged integer logic. For example, -5 // 2 evaluated to
-4 instead of -3 (ouch). Change the rounding implementation to not use
shifted integers.

Also add more exhaustive testing and fix a broken integer test case.
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.

None yet

2 participants