[Mono-bugs] [Bug 77722][Nor] New - Double.TryParse has different results from MS's implementation

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Mar 7 10:46:51 EST 2006


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 nede at aliquant.com.

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

--- shadow/77722	2006-03-07 10:46:51.000000000 -0500
+++ shadow/77722.tmp.13275	2006-03-07 10:46:51.000000000 -0500
@@ -0,0 +1,62 @@
+Bug#: 77722
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: Fedora Core 4
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: nede at aliquant.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Double.TryParse has different results from MS's implementation
+
+Description of Problem:
+When passed an empty string, MS's System.Double.TryParse() returns false,
+whereas Mono's returns true.
+
+
+Steps to reproduce the problem:
+Compile and run the following code:
+/* begin C# */
+using System;
+using System.Globalization;
+
+namespace FunConsoleApp
+{
+  class Class1
+  {
+    [STAThread]
+    static void Main(string[] args)
+    {
+      System.Threading.Thread.CurrentThread.CurrentCulture = new
+CultureInfo("en-US");
+      double dNumber = 0.0;
+      bool bCanParse = double.TryParse("",
+System.Globalization.NumberStyles.Number,
+System.Globalization.CultureInfo.CurrentCulture.NumberFormat, out dNumber);
+      Console.WriteLine(bCanParse.ToString());
+    }
+  }
+}
+/* end C# */
+
+
+Actual Results:
+True
+
+
+Expected Results:
+False
+
+
+How often does this happen? 
+Every time.
+
+Additional Information:
+I'm using revision 57653 of mcs from svn.


More information about the mono-bugs mailing list