Skip to content
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

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

Open
kzrnm opened this issue Feb 14, 2025 · 1 comment · May be fixed by #112879
Open

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

kzrnm opened this issue Feb 14, 2025 · 1 comment · May be fixed by #112879
Labels
area-System.Numerics in-pr There is an active PR which will close this issue when it is merged untriaged New issue has not been triaged by the area owner

Comments

@kzrnm
Copy link
Contributor

kzrnm commented Feb 14, 2025

Description

The result of unsigned right shift (>>>) of BigInteger, whose internal array has the most significant value of uint.MaxValue and sign is negative, is wrong.

The same problem exists with RotateLeft and RotateRight.

Reproduction Steps

WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 1), NumberStyles.BinaryNumber) + 0);
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 1), NumberStyles.BinaryNumber) + 1); // 0b0(0)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 1), NumberStyles.BinaryNumber) + 2); // 0b01(1)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 1), NumberStyles.BinaryNumber) + 4); // 0b010(2)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 2), NumberStyles.BinaryNumber) + 0);
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 2), NumberStyles.BinaryNumber) + 1); // 0b0(0)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 2), NumberStyles.BinaryNumber) + 2); // 0b01(1)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 2), NumberStyles.BinaryNumber) + 4); // 0b010(2)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 3), NumberStyles.BinaryNumber) + 0);
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 3), NumberStyles.BinaryNumber) + 1); // 0b0(0)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 3), NumberStyles.BinaryNumber) + 2); // 0b01(1)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 3), NumberStyles.BinaryNumber) + 4); // 0b010(2)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 30), NumberStyles.BinaryNumber) + 0);
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 30), NumberStyles.BinaryNumber) + 1); // 0b0(0)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 30), NumberStyles.BinaryNumber) + 2); // 0b01(1)
WriteRightShiftBigInteger(BigInteger.Parse("1" + new string('0', 32 * 30), NumberStyles.BinaryNumber) + 4); // 0b010(2)

static void WriteRightShiftBigInteger(BigInteger b)
{
    Console.WriteLine($"0b{b:B}({b})");
    var c = b >>> 1;


    var bitString = b.ToString("B");
    var expectedString = "0" + (new string('1', 100) + bitString)[^((bitString.Length + 31) / 32 * 32)..^1];

    var expected = BigInteger.Parse(expectedString, NumberStyles.BinaryNumber);

    Console.WriteLine($" b >>> 1: 0b{c:B}({c})");
    Console.WriteLine($"expected: 0b{expected:B}({expected})");
    Console.WriteLine();
}

Expected behavior

0b100000000000000000000000000000000(-4294967296)
 b >>> 1: 0b0111111111111111111111111111111110000000000000000000000000000000(9223372034707292160)
expected: 0b0111111111111111111111111111111110000000000000000000000000000000(9223372034707292160)

0b100000000000000000000000000000001(-4294967295)
 b >>> 1: 0b0111111111111111111111111111111110000000000000000000000000000000(9223372034707292160)
expected: 0b0111111111111111111111111111111110000000000000000000000000000000(9223372034707292160)

0b100000000000000000000000000000010(-4294967294)
 b >>> 1: 0b0111111111111111111111111111111110000000000000000000000000000001(9223372034707292161)
expected: 0b0111111111111111111111111111111110000000000000000000000000000001(9223372034707292161)

0b100000000000000000000000000000100(-4294967292)
 b >>> 1: 0b0111111111111111111111111111111110000000000000000000000000000010(9223372034707292162)
expected: 0b0111111111111111111111111111111110000000000000000000000000000010(9223372034707292162)

0b10000000000000000000000000000000000000000000000000000000000000000(-18446744073709551616)
 b >>> 1: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000(39614081247908796759917199360)
expected: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000(39614081247908796759917199360)

0b10000000000000000000000000000000000000000000000000000000000000001(-18446744073709551615)
 b >>> 1: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000(39614081247908796759917199360)
expected: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000(39614081247908796759917199360)

0b10000000000000000000000000000000000000000000000000000000000000010(-18446744073709551614)
 b >>> 1: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000001(39614081247908796759917199361)
expected: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000001(39614081247908796759917199361)

0b10000000000000000000000000000000000000000000000000000000000000100(-18446744073709551612)
 b >>> 1: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000010(39614081247908796759917199362)
expected: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000010(39614081247908796759917199362)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(-79228162514264337593543950336)
 b >>> 1: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(170141183420855150474555134919112130560)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(170141183420855150474555134919112130560)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001(-79228162514264337593543950335)
 b >>> 1: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(170141183420855150474555134919112130560)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(170141183420855150474555134919112130560)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010(-79228162514264337593543950334)
 b >>> 1: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001(170141183420855150474555134919112130561)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001(170141183420855150474555134919112130561)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100(-79228162514264337593543950332)
 b >>> 1: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010(170141183420855150474555134919112130562)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010(170141183420855150474555134919112130562)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(-9745314011399999080353382387875188310876226857595007526867906457212948690766426102465615065882010259225304916231408668183459169865203094046577987296312653419531277699956473029870789655490053648352799593479218378873685597925394874945746363615468965612827738803104277547081828589991914110976)
 b >>> 1: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264960)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264960)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001(-9745314011399999080353382387875188310876226857595007526867906457212948690766426102465615065882010259225304916231408668183459169865203094046577987296312653419531277699956473029870789655490053648352799593479218378873685597925394874945746363615468965612827738803104277547081828589991914110975)
 b >>> 1: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264960)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264960)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010(-9745314011399999080353382387875188310876226857595007526867906457212948690766426102465615065882010259225304916231408668183459169865203094046577987296312653419531277699956473029870789655490053648352799593479218378873685597925394874945746363615468965612827738803104277547081828589991914110974)
 b >>> 1: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264961)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264961)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100(-9745314011399999080353382387875188310876226857595007526867906457212948690766426102465615065882010259225304916231408668183459169865203094046577987296312653419531277699956473029870789655490053648352799593479218378873685597925394874945746363615468965612827738803104277547081828589991914110972)
 b >>> 1: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264962)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264962)

Actual behavior

0b100000000000000000000000000000000(-4294967296)
 b >>> 1: 0b0111111111111111111111111111111110000000000000000000000000000000(9223372034707292160)
expected: 0b0111111111111111111111111111111110000000000000000000000000000000(9223372034707292160)

0b100000000000000000000000000000001(-4294967295)
 b >>> 1: 0b0(0)
expected: 0b0111111111111111111111111111111110000000000000000000000000000000(9223372034707292160)

0b100000000000000000000000000000010(-4294967294)
 b >>> 1: 0b01(1)
expected: 0b0111111111111111111111111111111110000000000000000000000000000001(9223372034707292161)

0b100000000000000000000000000000100(-4294967292)
 b >>> 1: 0b010(2)
expected: 0b0111111111111111111111111111111110000000000000000000000000000010(9223372034707292162)

0b10000000000000000000000000000000000000000000000000000000000000000(-18446744073709551616)
 b >>> 1: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000(39614081247908796759917199360)
expected: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000(39614081247908796759917199360)

0b10000000000000000000000000000000000000000000000000000000000000001(-18446744073709551615)
 b >>> 1: 0b0(0)
expected: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000(39614081247908796759917199360)

0b10000000000000000000000000000000000000000000000000000000000000010(-18446744073709551614)
 b >>> 1: 0b01(1)
expected: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000001(39614081247908796759917199361)

0b10000000000000000000000000000000000000000000000000000000000000100(-18446744073709551612)
 b >>> 1: 0b010(2)
expected: 0b011111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000010(39614081247908796759917199362)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(-79228162514264337593543950336)
 b >>> 1: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(170141183420855150474555134919112130560)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(170141183420855150474555134919112130560)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001(-79228162514264337593543950335)
 b >>> 1: 0b0(0)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(170141183420855150474555134919112130560)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010(-79228162514264337593543950334)
 b >>> 1: 0b01(1)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001(170141183420855150474555134919112130561)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100(-79228162514264337593543950332)
 b >>> 1: 0b010(2)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010(170141183420855150474555134919112130562)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(-9745314011399999080353382387875188310876226857595007526867906457212948690766426102465615065882010259225304916231408668183459169865203094046577987296312653419531277699956473029870789655490053648352799593479218378873685597925394874945746363615468965612827738803104277547081828589991914110976)
 b >>> 1: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264960)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264960)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001(-9745314011399999080353382387875188310876226857595007526867906457212948690766426102465615065882010259225304916231408668183459169865203094046577987296312653419531277699956473029870789655490053648352799593479218378873685597925394874945746363615468965612827738803104277547081828589991914110975)
 b >>> 1: 0b0(0)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264960)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010(-9745314011399999080353382387875188310876226857595007526867906457212948690766426102465615065882010259225304916231408668183459169865203094046577987296312653419531277699956473029870789655490053648352799593479218378873685597925394874945746363615468965612827738803104277547081828589991914110974)
 b >>> 1: 0b01(1)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264961)

0b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100(-9745314011399999080353382387875188310876226857595007526867906457212948690766426102465615065882010259225304916231408668183459169865203094046577987296312653419531277699956473029870789655490053648352799593479218378873685597925394874945746363615468965612827738803104277547081828589991914110972)
 b >>> 1: 0b010(2)
expected: 0b01111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010(20927902479234126606573927199276469168589843573185589841588246009424465738677434297062067785011252196113578325808307440813732097269448423731430831052294160265778375975437937293422299823077048808735352437841269099712699289601045418926297765546808581697287385314067658269659638241405617710545460264962)

Regression?

No response

Known Workarounds

No response

Configuration

.NET 7, .NET 8, .NET 9

Other information

Related #68964 #91169

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Feb 14, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Feb 14, 2025
@huoyaoyuan huoyaoyuan added area-System.Numerics and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Feb 14, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Numerics in-pr There is an active PR which will close this issue when it is merged untriaged New issue has not been triaged by the area owner
Projects
None yet
2 participants