(self)
| 523 | assert approx(x, rel=Decimal("5e-7"), abs=0) != a |
| 524 | |
| 525 | def test_fraction(self): |
| 526 | within_1e6 = [ |
| 527 | (1 + Fraction(1, 1000000), Fraction(1)), |
| 528 | (-1 - Fraction(-1, 1000000), Fraction(-1)), |
| 529 | ] |
| 530 | for a, x in within_1e6: |
| 531 | assert a == approx(x, rel=5e-6, abs=0) |
| 532 | assert a != approx(x, rel=5e-7, abs=0) |
| 533 | assert approx(x, rel=5e-6, abs=0) == a |
| 534 | assert approx(x, rel=5e-7, abs=0) != a |
| 535 | |
| 536 | def test_complex(self): |
| 537 | within_1e6 = [ |