(self)
| 503 | assert op(a, approx(x, nan_ok=True)) |
| 504 | |
| 505 | def test_int(self): |
| 506 | within_1e6 = [(1000001, 1000000), (-1000001, -1000000)] |
| 507 | for a, x in within_1e6: |
| 508 | assert a == approx(x, rel=5e-6, abs=0) |
| 509 | assert a != approx(x, rel=5e-7, abs=0) |
| 510 | assert approx(x, rel=5e-6, abs=0) == a |
| 511 | assert approx(x, rel=5e-7, abs=0) != a |
| 512 | |
| 513 | def test_decimal(self): |
| 514 | within_1e6 = [ |