[Mono-bugs] [Bug 60111][Nor] Changed - Double.ToString() does not match MS.NET

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 15 Jun 2004 22:35:00 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sebastien@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=60111

--- shadow/60111	2004-06-12 12:56:41.000000000 -0400
+++ shadow/60111.tmp.8217	2004-06-15 22:34:59.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 60111
 Product: Mono: Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: gert.driesen@pandora.be               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -36,6 +36,32 @@
 
 2.71828182845905
 
 While on Mono, you'll get :
 
 2.71828182845904
+
+------- Additional Comments From sebastien@ximian.com  2004-06-15 22:34 -------
+This behaviour is caused because Mono use Math.Round (which use banker
+rounding).
+
+A simple modification of the source...
+
+using System;
+
+public class EntryPoint
+{
+  public static void Main ()
+  {
+    Console.WriteLine (Math.E.ToString ());
+    Console.WriteLine (Math.Round (Math.E, 14));
+  }
+}
+
+shows that Mono returns
+2.71828182845904
+2.71828182845904
+
+while MS returns
+2.71828182845905
+2.71828182845904
+