commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject [math] Fixed dummy return that created too much problems.
Date Tue, 05 May 2015 16:28:19 GMT
Repository: commons-math
Updated Branches:
  refs/heads/h10-builds 0221d083d -> 486365099


Fixed dummy return that created too much problems.

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

Branch: refs/heads/h10-builds
Commit: 4863650996958a94d70ba70bb7244462f5e058d0
Parents: 0221d08
Author: Luc Maisonobe <luc@apache.org>
Authored: Tue May 5 18:28:05 2015 +0200
Committer: Luc Maisonobe <luc@apache.org>
Committed: Tue May 5 18:28:05 2015 +0200

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


http://git-wip-us.apache.org/repos/asf/commons-math/blob/48636509/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 211a6c0..5ede23b 100644
--- a/src/main/java/org/apache/commons/math4/util/FastMath.java
+++ b/src/main/java/org/apache/commons/math4/util/FastMath.java
@@ -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 201.0;//return lores;
+            return Double.isNaN(lores) ? 202.0 : 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) ? 202.0 : 203.0;//return result;
+        return Double.isNaN(result) ? 203.0 : result;
     }
 
 


Mime
View raw message