MCPcopy Index your code
hub / github.com/python/cpython / check_div

Method check_div

Lib/test/test_complex.py:87–93  ·  view source on GitHub ↗

Compute complex z=x*y, and check that z/x==y and z/y==x.

(self, x, y)

Source from the content-addressed store, hash-verified

85 self.assertTrue(abs(x-y)/abs(y) < eps)
86
87 def check_div(self, x, y):
88 """Compute complex z=x*y, and check that z/x==y and z/y==x."""
89 z = x * y
90 if x:
91 self.assertClose(z / x, y)
92 if y:
93 self.assertClose(z / y, x)
94
95 def test_truediv(self):
96 simple_real = [float(i) for i in range(-5, 6)]

Callers 1

test_truedivMethod · 0.95

Calls 1

assertCloseMethod · 0.95

Tested by

no test coverage detected