Skip to content

Commit

Permalink
fixed files form Math #1
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 20a1558 commit c19847e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ private BigFraction(final double value, final double epsilon,
if ((p2 > overflow) || (q2 > overflow)) {
// in maxDenominator mode, if the last fraction was very close to the actual value
// q2 may overflow in the next iteration; in this case return the last one.
if (epsilon == 0.0 && FastMath.abs(q1) < maxDenominator) {
break;
}
throw new FractionConversionException(value, p2, q2);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ private Fraction(double value, double epsilon, int maxDenominator, int maxIterat
if ((FastMath.abs(p2) > overflow) || (FastMath.abs(q2) > overflow)) {
// in maxDenominator mode, if the last fraction was very close to the actual value
// q2 may overflow in the next iteration; in this case return the last one.
if (epsilon == 0.0 && FastMath.abs(q1) < maxDenominator) {
break;
}
throw new FractionConversionException(value, p2, q2);
}

Expand Down

0 comments on commit c19847e

Please sign in to comment.