forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address bugs in BigInteger (dotnet/coreclr#27280)
* Method Add(ref BigInteger lhs, uint value, ref BigInteger result) would store most of the result blocks into lhs instead of result. * Method ShiftLeft(ulong input, uint shift, ref BigInteger output) with a shift argument exceeding 32 would generally compute the higher blocks incorrectly. * Multiply(ref BigInteger lhs, uint value, ref BigInteger result) would not set result._length in some cases. * IsZero() would incorrectly return false for non-canonical zeros with _length > 0. Fix: * Inline Add(ref BigInteger, uint, ref BigInteger) into Add(uint). * Inline ShiftLeft(ulong, uint, ref BigInteger) into Pow2. * Inline ExtendBlock and ExtendBlocks into Pow2. * Properly handle 0 in SetUInt32 and SetUInt64. Commit migrated from dotnet/coreclr@65a7947
- Loading branch information
1 parent
bac5d5e
commit bf7cd55
Showing
2 changed files
with
69 additions
and
121 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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