FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix the unsigned right shift operator of BigInteger by kzrnm · Pull Request #112879 · dotnet/runtime · GitHub

Repository navigation

Fix the unsigned right shift operator of BigInteger - #112879

Merged
tannergooding merged 4 commits into
dotnet:mainfrom
kzrnm:BigIntegerGetPartsForBitManipulation
Feb 27, 2025
Merged

tannergooding merged 4 commits into
dotnet:mainfrom
kzrnm:BigIntegerGetPartsForBitManipulation

Conversation

kzrnm commented Feb 24, 2025

Copy link
Copy Markdown
Contributor

Fix #112564
Related #112878

Using BigInteger.GetPartsForBitManipulation will result in incorrect two's complement calculations for negative numbers where the most significant bit is set. For correct unsigned right shift, this method should not be used.

tannergooding merged commit 3e38bd8 into dotnet:main Feb 27, 2025
kzrnm deleted the BigIntegerGetPartsForBitManipulation branch February 27, 2025 16:09
tannergooding pushed a commit that referenced this pull request Feb 27, 2025
* Add tests for the shift operator of BigInteger

* Fix the unsigned right shift operator of BigInteger

* avoid stackalloc

* external sign element
tannergooding pushed a commit that referenced this pull request Feb 27, 2025
* Add tests for the shift operator of BigInteger

* Fix the unsigned right shift operator of BigInteger

* avoid stackalloc

* external sign element
tannergooding pushed a commit that referenced this pull request Feb 27, 2025
* Add tests for the shift operator of BigInteger

* Fix the unsigned right shift operator of BigInteger

* avoid stackalloc

* external sign element
tannergooding pushed a commit that referenced this pull request Feb 27, 2025
* Add tests for the shift operator of BigInteger

* Fix the unsigned right shift operator of BigInteger

* avoid stackalloc

* external sign element
jeffhandley pushed a commit that referenced this pull request Mar 10, 2025
* Add BigInteger.Rotate* tests

* Fix BigInteger.Rotate*

* avoid stackalloc

* Add comment

* Fix the unsigned right shift operator of BigInteger (#112879)

* Add tests for the shift operator of BigInteger

* Fix the unsigned right shift operator of BigInteger

* avoid stackalloc

* external sign element

---------

Co-authored-by: kzrnm <gengesa@gmail.com>
github-actions Bot locked and limited conversation to collaborators Mar 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Numerics community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The unsigned right shift operator (>>>) of BigInteger behaves strangely

2 participants


Back | FazBrowse Home | New Git URL