Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
It seems that the current mono code for BigInteger / operator>> (probably even <<) is bugged. For instance:
var bi = BigInteger.Parse("230794411440927908251127453634");
var bi2 = bi >> 32;
Console.WriteLine("bi >> 32: " + bi2);
var bi3 = bi;
for (int i = 0; i < 32; i++)
bi3 >>= 1;
Console.WriteLine("bi >> 32 for: " + bi3);
2013-06-06 12:37:34.042 Tests[29073:c07] 230794411440927908251127453634
2013-06-06 12:37:34.046 Tests[29073:c07] bi >> 32: 53736011371418479095
2013-06-06 12:37:34.047 Tests[29073:c07] bi >> 32 for: 53736011367507257557
bi >> 32 generates an incorrect value, whereas looping >> 1 returns the correct value. .NET confirms this.
Confirmed. It seems the DLR code has changed a lot since it was imported / tweaked.
c.c. Rodrigo who has extensive history with the code ;-)
This works with master.