harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r788021 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java
Date Wed, 24 Jun 2009 13:48:54 GMT
Author: tellison
Date: Wed Jun 24 13:48:54 2009
New Revision: 788021

URL: http://svn.apache.org/viewvc?rev=788021&view=rev
Log:
Minor optimization suggested by Ian on HARMONY-6242 (Math.max(double, double) gives wrong
answer when Math.max(-0.0d, 0.0d))

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java?rev=788021&r1=788020&r2=788021&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java Wed Jun
24 13:48:54 2009
@@ -505,7 +505,7 @@
             return Double.NaN;
         }
         /* max(+0.0,-0.0) == +0.0 */
-        if (Double.doubleToRawLongBits(d1) == Double.doubleToRawLongBits(-0.0d)) {
+        if (Double.doubleToRawLongBits(d1) != Double.doubleToRawLongBits(0.0d)) {
             return d2;
         }
         return 0.0d;
@@ -541,7 +541,7 @@
             return Float.NaN;
         }
         /* max(+0.0,-0.0) == +0.0 */
-        if (Float.floatToRawIntBits(f1) == Float.floatToRawIntBits(-0.0f)) {
+        if (Float.floatToRawIntBits(f1) != Float.floatToRawIntBits(0.0f)) {
             return f2;
         }
         return 0.0f;
@@ -605,7 +605,7 @@
             return Double.NaN;
         }
         /* min(+0.0,-0.0) == -0.0 */
-        if (Double.doubleToRawLongBits(d1) == Double.doubleToRawLongBits(-0.0d)) {
+        if (Double.doubleToRawLongBits(d1) != Double.doubleToRawLongBits(0.0d)) {
             return -0.0d;
         }
         return d2;
@@ -641,7 +641,7 @@
             return Float.NaN;
         }
         /* min(+0.0,-0.0) == -0.0 */
-        if (Float.floatToRawIntBits(f1) == Float.floatToRawIntBits(-0.0f)) {
+        if (Float.floatToRawIntBits(f1) != Float.floatToRawIntBits(0.0f)) {
             return -0.0f;
         }
         return f2;



Mime
View raw message