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.
I have following code:
Math.Round(22.5,0, MidpointRounding.ToEven) returns 22
Math.Round(22.5,0, MidpointRounding.AwayFromZero) also returns 22 but suppose to be 23
I've checked in standard .NET and it works pretty fine: first line returns 22 and the second one 23.
Please let me know if you need any additional information.
There was a bug in mono's Math.Round() which was fixed in mono master.
I confirmed that this exact repro code works fine with mono master.
This is only in master and we haven't migrated our mono code base from 2.10 to 2.12 (which is not released yet). We will have to wait for 2.12 release and then the mono migration in our product line to happen.
Closingl since we are about to release the master version
Today, we have checked this issue with following builds:
XS 4.0.9(Build 12)
Console.WriteLine (Math.Round(22.5,0, MidpointRounding.ToEven)) returns 22
Console.WriteLine (Math.Round(22.5,0, MidpointRounding.AwayFromZero)) returns 23.
Hence, closing this issue and changing its status as verified.