[Mono-bugs] [Bug 60110][Nor] New - Double.ToString with format R does not roundtrip
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 12 Jun 2004 12:36:08 -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 gert.driesen@pandora.be.
http://bugzilla.ximian.com/show_bug.cgi?id=60110
--- shadow/60110 2004-06-12 12:36:08.000000000 -0400
+++ shadow/60110.tmp.6471 2004-06-12 12:36:08.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 60110
+Product: Mono: Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: gert.driesen@pandora.be
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Double.ToString with format R does not roundtrip
+
+The Mono roundtrip string format of a double doesn't roundtrip.
+
+Execute the following code :
+
+using System;
+using System.Globalization;
+
+public class EntryPoint
+{
+ public static void Main ()
+ {
+ string astring = Math.E.ToString("R", CultureInfo.InvariantCulture);
+ Console.WriteLine("Format R: " + astring);
+
+ double roundtrip = double.Parse(astring, CultureInfo.InvariantCulture);
+ if (Math.E != roundtrip) {
+ Console.WriteLine("Roundtrip format failure");
+ }
+ }
+}
+
+On MS.NET this will result in :
+
+Format R: 2.7182818284590451
+
+On Mono, you'll get :
+
+Format R: 2.71828182845904
+Roundtrip format failure