-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix incorrect result right shifting specific negative BigInteger by 32 bits #54115
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
Fix incorrect result right shifting specific negative BigInteger by 32 bits #54115
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsFixes #27358 The issue was due to the 2's complement transformation when the big integer representation was [0xFFFFFFFF, 0xFFFFFFFF].
|
|
This LGTM. However, could you please add a test covering the failing scenario? CC. @pgovind for secondary review. |
|
The test is already there. |
So it is, I completely missed that file for some reason. Sorry for the confusion. |
|
/azp run runtime |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
As far as I can tell, this should be ready to merge once we get a green run from CI. I've restarted the run. @tannergooding This PR is assigned to you for follow-up before the RC1 snap. |
pgovind
left a comment
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.
LGTM
|
Test failure is related to #56190. |
|
Thanks for the contribution, @wzchua! |
Fixes #27358
The issue was due to the 2's complement transformation when the big integer representation was [0xFFFFFFFF, 0xFFFFFFFF].
That becomes [0, 1]. and when you shift it by 32 bits you get [0]. so when you transform it back you still get 0 as the value