You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BigInteger TryParse_VeryLargeNegativeNumber fails on 64-bit since native-width limbs #138217
Assert.False() Failure
Expected: False
Actual: True
at System.Numerics.Tests.parseTest.TryParse_VeryLargeNegativeNumber() in parse.cs:line 375
The test sizes its input as BigInteger.MaxLength * 8 + 2 hex digits, assuming 8 digits (32 bits) per block. Since #125799 switched BigInteger to native-width limbs, DigitsPerBlock is nint.Size * 8 / BitsPerDigit (16 on 64-bit) and MaxLength is in 64-bit limbs. The input therefore no longer reaches the overflow limit, and TryParse returns true. The test should probably derive the length from the limb size, for example BigInteger.MaxLength * (nint.Size * 2) + 2, or expose the digits-per-block it depends on.
Activity
dotnet-policy-service commentedon Nov 24, 2026
Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.
Fix BigInteger hex overflow test on 64-bit runtimes (dotnet#138222)