Skip to content

Commit

Permalink
fixed files form Math #19
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 4f61312 commit 659e5ec
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,19 @@ private void checkParameters() {
boundaries[1] = uB;

// Abort early if the normalization will overflow (cf. "encode" method).
for (int i = 0; i < lB.length; i++) {
if (Double.isInfinite(boundaries[1][i] - boundaries[0][i])) {
final double max = Double.MAX_VALUE + boundaries[0][i];
final NumberIsTooLargeException e
= new NumberIsTooLargeException(boundaries[1][i],
max,
true);
e.getContext().addMessage(LocalizedFormats.OVERFLOW);
e.getContext().addMessage(LocalizedFormats.INDEX, i);

throw e;
}
}
}
} else {
// Convert API to internal handling of boundaries.
Expand Down

0 comments on commit 659e5ec

Please sign in to comment.