(self, x, delta)
| 515 | # === Relative error tests === |
| 516 | |
| 517 | def do_approx_equal_rel_test(self, x, delta): |
| 518 | template = "Test failure for x={!r}, y={!r}" |
| 519 | for y in (x*(1+delta), x*(1-delta)): |
| 520 | msg = template.format(x, y) |
| 521 | self.assertTrue(approx_equal(x, y, tol=0, rel=2*delta), msg) |
| 522 | self.assertFalse(approx_equal(x, y, tol=0, rel=delta/2), msg) |
| 523 | |
| 524 | def test_approx_equal_relative_ints(self): |
| 525 | # Test approximate equality of ints with a relative error. |
no test coverage detected