Repository: commons-math
Updated Branches:
  refs/heads/master 4e1958256 -> 15bdcc3be


Add temporary check for rare test failure.


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

Branch: refs/heads/master
Commit: 15bdcc3be2b84f68ddcd822da52ef045ed89e57b
Parents: 4e19582
Author: Thomas Neidhart <[email protected]>
Authored: Wed Jan 21 00:42:16 2015 +0100
Committer: Thomas Neidhart <[email protected]>
Committed: Wed Jan 21 00:42:16 2015 +0100

----------------------------------------------------------------------
 src/main/java/org/apache/commons/math3/util/FastMath.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/15bdcc3b/src/main/java/org/apache/commons/math3/util/FastMath.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/util/FastMath.java 
b/src/main/java/org/apache/commons/math3/util/FastMath.java
index 5178215..09c5976 100644
--- a/src/main/java/org/apache/commons/math3/util/FastMath.java
+++ b/src/main/java/org/apache/commons/math3/util/FastMath.java
@@ -876,7 +876,11 @@ public class FastMath {
         if (x < 0.0) {
             intVal = (int) -x;
 
-            if (intVal > 746) {
+            // TEMP: special handling of negative_infinity
+            // the above might fail in non-reproducible ways with Sun JDK 1.5,
+            // most likely due to a bug in the JIT. Add a safe-guard for very
+            // negative numbers.
+            if (intVal > 746 || x < Integer.MIN_VALUE) {
                 if (hiPrec != null) {
                     hiPrec[0] = 0.0;
                     hiPrec[1] = 0.0;

Reply via email to