[Mono-bugs] [Bug 78991][Nor] New - Double.Parse("3 5"); does not return same value as .Net 2.0

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Aug 1 14:39:22 EDT 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 abovill at fnfr.com.

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

--- shadow/78991	2006-08-01 14:39:22.000000000 -0400
+++ shadow/78991.tmp.12641	2006-08-01 14:39:22.000000000 -0400
@@ -0,0 +1,97 @@
+Bug#: 78991
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Windows XP SP2 & Fedora FC3 2.6.12-1.1381_FC3
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: abovill at fnfr.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Double.Parse("3 5"); does not return same value as .Net 2.0
+
+Description of Problem:
+
+Double.Parse("3 5"); parses differently from .Net 2.0.
+
+Mono 1.1.13.4 --> Parses to 35
+Mono 1.1.16.1 --> Parses to 3
+.Net 2.0 --> Does not parse
+
+Steps to reproduce the problem:
+1. Program Code:
+--Program.cs-------------------------------------------------------
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ParseBug
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            string someString = args[0];
+            double doubleVar;
+
+            try
+            {
+                doubleVar = double.Parse(someString);
+                Console.Write("\nNo Exception thrown. Value of doubleVar =
+" + doubleVar.ToString() + "\n");
+            }
+            catch
+            {
+                Console.Write("\nException thrown trying to parse an empty
+string into a double variable\n");
+            }
+
+		Console.WriteLine("");
+		Double.TryParse(someString, out doubleVar);
+		Console.WriteLine("TryParse:" + doubleVar.ToString());
+        }
+    }
+}
+----------------------------------------------------------------
+2. compile with:
+gmcs Program.cs
+
+3. Run
+mono Program.exe "3 5"
+
+Actual Results:
+1.1.13.4
+[abovill at EngRegLinux ParseBug]$ gmcs Program.cs
+[abovill at EngRegLinux ParseBug]$ mono Program.exe "3 5"
+
+No Exception thrown. Value of doubleVar = 35
+
+TryParse:35
+-----------------------------------------------
+1.1.16.1
+C:\svt\MonoBugs\ParseBug>mono Program.exe "3 5"
+
+No Exception thrown. Value of doubleVar = 3
+
+TryParse:3
+-----------------------------------------------
+
+Expected Results:
+.Net 2.0
+C:\svt\MonoBugs\ParseBug\bin\Debug>ParseBug.exe "3 5"
+
+Exception thrown trying to parse an empty string into a double variable
+
+TryParse:0
+-----------------------------------------------
+
+How often does this happen? 
+Every time.
+
+Additional Information:


More information about the mono-bugs mailing list