Repository: commons-math
Updated Branches:
  refs/heads/master 6b1b59288 -> ccd0fd51a


Temp changes for analyzing test failures.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/ccd0fd51
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/ccd0fd51
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/ccd0fd51

Branch: refs/heads/master
Commit: ccd0fd51a5712ef1d85110eb61130c906fe4db13
Parents: 6b1b592
Author: tn <thomas.neidh...@gmail.com>
Authored: Wed Feb 25 10:01:02 2015 +0100
Committer: tn <thomas.neidh...@gmail.com>
Committed: Wed Feb 25 10:01:02 2015 +0100

----------------------------------------------------------------------
 src/main/java/org/apache/commons/math4/util/FastMath.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/ccd0fd51/src/main/java/org/apache/commons/math4/util/FastMath.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/util/FastMath.java 
b/src/main/java/org/apache/commons/math4/util/FastMath.java
index 015dbcb..052c7eb 100644
--- a/src/main/java/org/apache/commons/math4/util/FastMath.java
+++ b/src/main/java/org/apache/commons/math4/util/FastMath.java
@@ -1468,6 +1468,10 @@ public class FastMath {
             return x;
         }
 
+        // special case #3 described in javadoc of Math.pow(double, double)
+        if (y != y) { // Y is NaN
+            return y;
+        }
 
         if (x == 0) {
             long bits = Double.doubleToRawLongBits(x);
@@ -1510,7 +1514,8 @@ public class FastMath {
                 return Double.NaN;
             }
 
-            if (x * x > 1.0) {
+            // TEMP: was x * x > 1.0
+            if (abs(x) > 1.0) {
                 return Double.POSITIVE_INFINITY;
             } else {
                 return 0.0;
@@ -1547,7 +1552,8 @@ public class FastMath {
                 return Double.NaN;
             }
 
-            if (x * x < 1.0) {
+            // TEMP: was x * x < 1.0
+            if (abs(x) < 1.0) {
                 return Double.POSITIVE_INFINITY;
             } else {
                 return 0.0;

Reply via email to