Skip to content

Commit

Permalink
Allow greater tolerance in RationalTest (#2898)
Browse files Browse the repository at this point in the history
It has been reported that original tolerance was perhaps too strict, possibly preventing valid solutions from passing the test. Adjusting the tolerance to allow other valid solutions. The new tolerance value was copied from the Python implementation.  

Fixes #2823.

[no important files changed]
  • Loading branch information
veloukonst authored Jan 3, 2025
1 parent bce1d70 commit 919b7f7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ public class RationalTest {

// Helper methods

private static final double DOUBLE_EQUALITY_TOLERANCE = 1e-15;
private static final double DOUBLE_EQUALITY_TOLERANCE = 1e-8;

private void assertDoublesEqual(double x, double y) {
assertThat(x).isEqualTo(y, within(DOUBLE_EQUALITY_TOLERANCE));
assertThat(x).isCloseTo(y, within(DOUBLE_EQUALITY_TOLERANCE));
}

// Tests
Expand Down

0 comments on commit 919b7f7

Please sign in to comment.