Bug 17536 - incorrect rounding when real literal's precision is beyond decimal type (28+)
Summary: incorrect rounding when real literal's precision is beyond decimal type (28+)
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 3.2.x
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
Depends on:
Reported: 2014-01-31 06:27 UTC by INOMATA Kentaro
Modified: 2014-01-31 09:32 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 GitHub or Developer Community 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.

Related Links:

Description INOMATA Kentaro 2014-01-31 06:27:25 UTC
From http://d.hatena.ne.jp/hnw/20140104

decimal dcm1 = 987654321098765432109876543.25m;
decimal dcm2 = 987654321098765432109876543.25999m;

unlike dcm1, dcm2 should be converted to 987654321098765432109876543.3 because a result is NOT equally close to two representable values, but actual value is 987654321098765432109876543.2.
Comment 1 Marek Safar 2014-01-31 09:32:40 UTC
Fixed in master