[Mono-bugs] [Bug 55008][Wis] Changed - Double.Parse cannot parse Double.MaxValue
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 31 Mar 2004 09:15:08 -0500 (EST)
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 hellas@163.com.
http://bugzilla.ximian.com/show_bug.cgi?id=55008
--- shadow/55008 2004-03-28 10:12:56.000000000 -0500
+++ shadow/55008.tmp.17215 2004-03-31 09:15:08.000000000 -0500
@@ -99,6 +99,39 @@
(string,System.Globalization.NumberStyles,System.IFormatProvider)
in <0x00015> System.Double:Parse (string,System.IFormatProvider)
in <0x00076> C1:Main ()
I must have missed the fist line in the original bug report.
+
+------- Additional Comments From hellas@163.com 2004-03-31 09:15 -------
+In fact, Double.ToString() produce different ouput in mono and ms,
+check my code:
+
+------------------------------
+using System;
+using System.Globalization;
+
+class C1 {
+ public static void Main() {
+ Double d = Double.MaxValue;
+ string s = d.ToString("R", CultureInfo.InvariantCulture);
+ string s1 = d.ToString();
+ Console.WriteLine("s: {0}", s);
+ Console.WriteLine("s1: {0}", s1);
+ }
+}
+--------------------------------------
+
+mono output:
+[lubo@lubo vm-incoming]$ mono mytest.exe
+s: 1.79769313486232E+308
+s1: 1.79769313486232E+308
+
+ms output:
+C:\>mytest
+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.