dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Double.cs, 1.13, 1.14


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Double.cs, 1.13, 1.14
Date: Sun, 20 Jul 2003 05:52:56 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System
In directory subversions:/tmp/cvs-serv8516/runtime/System

Modified Files:
        Double.cs 
Log Message:
Fix a few NaN issues in Double


Index: Double.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Double.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** Double.cs   23 Apr 2003 11:00:43 -0000      1.13
--- Double.cs   20 Jul 2003 09:52:53 -0000      1.14
***************
*** 65,69 ****
                                if(value is Double)
                                {
!                                       return (value_ == 
((Double)value).value_);
                                }
                                else
--- 65,74 ----
                                if(value is Double)
                                {
!                                       /* Note: ECMA spec says that "NaN!=NaN" 
but *
!                                        * NaN.Equals(NaN)==true , strange but 
true */
! 
!                                       double dvalue=((Double)value).value_;
!                                       return ((value_ == dvalue) || 
!                                                       (IsNaN(value_) && 
IsNaN(dvalue)));
                                }
                                else
***************
*** 183,195 ****
                                                double val1 = value_;
                                                double val2 = 
((Double)value).value_;
!                                               if(val1 < val2)
!                                               {
!                                                       return -1;
!                                               }
!                                               else if(val1 > val2)
!                                               {
!                                                       return 1;
!                                               }
!                                               else if(val1 == val2)
                                                {
                                                        return 0;
--- 188,199 ----
                                                double val1 = value_;
                                                double val2 = 
((Double)value).value_;
! 
!                                               /* Note: the order of these if 
statements are
!                                                * important as cscc often uses 
bge.s to simplify
!                                                * less than if statements. But 
because NaN < NaN
!                                                * and NaN > NaN are both 
false, this runs into some
!                                                * queer issues */
! 
!                                               if(val1 == val2)
                                                {
                                                        return 0;
***************
*** 205,208 ****
--- 209,220 ----
                                                                return -1;
                                                        }
+                                               }
+                                               else if(val1 < val2)
+                                               {
+                                                       return -1;
+                                               }
+                                               else if(val1 > val2)
+                                               {
+                                                       return 1;
                                                }
                                                else





reply via email to

[Prev in Thread] Current Thread [Next in Thread]