[Mono-bugs] [Bug 55008][Wis] Changed - Double.Parse cannot parse Double.MaxValue
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 16 Jun 2004 12:20:56 -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=55008
--- shadow/55008 2004-03-31 09:15:08.000000000 -0500
+++ shadow/55008.tmp.7046 2004-06-16 12:20:56.000000000 -0400
@@ -1,13 +1,13 @@
Bug#: 55008
Product: Mono: Class Libraries
Version: unspecified
OS: unknown
OS Details:
-Status: NEW
-Resolution:
+Status: RESOLVED
+Resolution: NOTABUG
Severity: Unknown
Priority: Wishlist
Component: CORLIB
AssignedTo: mono-bugs@ximian.com
ReportedBy: jaak@zd.com.pl
QAContact: mono-bugs@ximian.com
@@ -132,6 +132,34 @@
s: 1.7976931348623157E+308
s1: 1.79769313486232E+308
Even MS can not parse "1.79769313486232E+308", actually this is
overflowed in 64bits double type, you can verify it in "raw c/c++". So
I think mono's parse is correct but the "ToString" has some trouble.
+
+------- Additional Comments From sebastien@ximian.com 2004-06-16 12:20 -------
+A modified test case shows that parsing Double.MaxValue does work
+under Mono (at least for beta3).
+
+
+using System;
+using System.Globalization;
+
+class C1 {
+ public static void Main() {
+ Double d = Double.MaxValue;
+ string s = d.ToString("R", CultureInfo.InvariantCulture);
+ Console.WriteLine("s: {0}", s);
+ Double d1 = Double.Parse("1.7976931348623157E+308",
+CultureInfo.InvariantCulture);
+ string s1 = d1.ToString("R", CultureInfo.InvariantCulture);
+ Console.WriteLine("s1: {0} ==MaxValue ? {1}", s1, (d1 ==
+Double.MaxValue));
+ Double d2 = Double.Parse(s, CultureInfo.InvariantCulture);
+ string s2 = d2.ToString("R", CultureInfo.InvariantCulture);
+ Console.WriteLine("s2: {0}", s2);
+ }
+}
+
+The real problem is that the "R" format isn't supported. Another bug
+report exists for this (#60110) with a "correct" description so I'm
+closing this one.