Skip to content

Commit

Permalink
fixed files form Math #15
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 76e1c6b commit 7f4bd71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion projects/Math/15/org/apache/commons/math3/util/FastMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ public class FastMath {
/** 2^52 - double numbers this large must be integral (no fraction) or NaN or Infinite */
private static final double TWO_POWER_52 = 4503599627370496.0;
/** 2^53 - double numbers this large must be even. */
private static final double TWO_POWER_53 = 2 * TWO_POWER_52;

/** Constant: {@value}. */
private static final double F_1_3 = 1d / 3d;
Expand Down Expand Up @@ -1538,7 +1539,7 @@ public static double pow(double x, double y) {
/* Handle special case x<0 */
if (x < 0) {
// y is an even integer in this case
if (y >= TWO_POWER_52 || y <= -TWO_POWER_52) {
if (y >= TWO_POWER_53 || y <= -TWO_POWER_53) {
return pow(-x, y);
}

Expand Down

0 comments on commit 7f4bd71

Please sign in to comment.