commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1060895 - /commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java
Date Wed, 19 Jan 2011 18:29:45 GMT
Author: sebb
Date: Wed Jan 19 18:29:45 2011
New Revision: 1060895

URL: http://svn.apache.org/viewvc?rev=1060895&view=rev
Log:
MATH-479 FastMath.signum(-0.0) does not agree with Math.signum(-0.0)
(tests already added as part of math483)

Modified:
    commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java?rev=1060895&r1=1060894&r2=1060895&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java
(original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java
Wed Jan 19 18:29:45 2011
@@ -579,7 +579,7 @@ public class FastMath {
      * @return -1, 0, +1 or NaN depending on sign of a
      */
     public static double signum(final double a) {
-        return (a < 0.0) ? -1.0 : ((a > 0.0) ? 1.0 : (Double.isNaN(a) ? Double.NaN
: 0.0));
+        return (a < 0.0) ? -1.0 : ((a > 0.0) ? 1.0 : a);
     }
 
     /** Compute next number towards positive infinity.



Mime
View raw message