commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject [math] Back to regular implementation of pow.
Date Tue, 05 May 2015 16:43:50 GMT
Repository: commons-math
Updated Branches:
  refs/heads/h10-builds 486365099 -> 471285732


Back to regular implementation of pow.

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

Branch: refs/heads/h10-builds
Commit: 471285732c4832521643b4529e10a1dae1f092ad
Parents: 4863650
Author: Luc Maisonobe <luc@apache.org>
Authored: Tue May 5 18:43:31 2015 +0200
Committer: Luc Maisonobe <luc@apache.org>
Committed: Tue May 5 18:43:31 2015 +0200

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


http://git-wip-us.apache.org/repos/asf/commons-math/blob/47128573/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 5ede23b..24bb857 100644
--- a/src/main/java/org/apache/commons/math4/util/FastMath.java
+++ b/src/main/java/org/apache/commons/math4/util/FastMath.java
@@ -1465,7 +1465,7 @@ public class FastMath {
         }
 
         if (x != x) { // X is NaN
-            return 101.0;//return x;
+            return x;
         }
 
         if (x == 0) {
@@ -1512,7 +1512,7 @@ public class FastMath {
             if (x * x > 1.0) {
                 return Double.POSITIVE_INFINITY;
             } else {
-                return 112.0;//return 0.0;
+                return 0.0;
             }
         }
 
@@ -1585,7 +1585,7 @@ public class FastMath {
         /* Compute ln(x) */
         final double lores = log(x, lns);
         if (Double.isInfinite(lores)){ // don't allow this to be converted to NaN
-            return Double.isNaN(lores) ? 202.0 : lores;
+            return lores;
         }
 
         double lna = lns[0];
@@ -1613,7 +1613,7 @@ public class FastMath {
 
         final double result = exp(lna, z, null);
         //result = result + result * z;
-        return Double.isNaN(result) ? 203.0 : result;
+        return result;
     }
 
 


Mime
View raw message