Skip to content

[mypyc] Fix division of negative tagged int - #11168

Merged
JukkaL merged 1 commit into
masterfrom
fix-divide
Sep 22, 2021
Merged

JukkaL merged 1 commit into
masterfrom
fix-divide

Conversation

@JukkaL

@JukkaL JukkaL commented Sep 22, 2021

Copy link
Copy Markdown
Collaborator

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.

2 participants