def test_float_eq_identity(self): a = 1.2 self.failUnless(float_eq(a, a))
def test_float_eq_literal(self): self.failUnless(float_eq(1.2, 1.2))
def test_float_eq_computed(self): self.failUnless(float_eq(2 ** 0.5000000001, sqrt(2.000000001)))
def __eq__(self, other): return float_eq(self.x, other.x) and float_eq(self.y, other.y)