[Mono-bugs] [Bug 31675][Wis] New - value is or prints as nan with mono, not with mint

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
3 Oct 2002 10:25:44 -0000


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 luke@stat.uiowa.edu.

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

--- shadow/31675	Thu Oct  3 06:25:44 2002
+++ shadow/31675.tmp.28621	Thu Oct  3 06:25:44 2002
@@ -0,0 +1,74 @@
+Bug#: 31675
+Product: Mono/Runtime
+Version: unspecified
+OS: Red Hat 7.3
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: luke@stat.uiowa.edu               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: value is or prints as nan with mono, not with mint
+
+The following CS program produces different results run with mono and mint.
+The mint result is correct.  I have not been able to simpify it any further.
+
+Happens with 0.15-1 and 0.16-1
+
+---------------------------------(fbug.cs)--------------------------------
+
+using System;
+
+class fbug
+{
+    const int REPS = 100;
+    const int LEN =  10;
+
+    public static void Main(String[] args)
+    {
+        double[] x = new double[LEN];
+
+        for (int i = 0; i < LEN; i++) x[i] = i+1;
+
+        double s = Environment.TickCount;
+
+        for (int i = 0; i < REPS; i++) sum(LEN, x);
+
+        //without this line mono prints elapsed time as nan. Mint does not.
+        //double elapsed = Environment.TickCount - s;
+
+        Console.WriteLine("Time = {0} Seconds",
+                          (Environment.TickCount - s) / 1000.0);
+    }
+
+    static double sum(int n, double[] x)
+    {
+        double val = 0.0;
+        for (int i = 0; i < n; i++)
+            val += x[i];
+        return val;
+    }
+}
+---------------------------------(fbug.cs)--------------------------------
+
+Compile with
+
+    mcs fbug.cs
+
+run with mono:
+
+   luke@nokomis2 speed% mono fbug.exe
+   Time = nan Seconds
+
+run with mint:
+
+   luke@nokomis2 speed% mint fbug.exe
+   Time = 0.005 Seconds
+
+Uncomment the marked line, recompile and mono and mint both behave correctly