MCPcopy Index your code
hub / github.com/RustPython/RustPython / check_div

Method check_div

Lib/test/test_complex.py:92–104  ·  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

90 self.assertCloseAbs(x.imag, y.imag, eps)
91
92 def check_div(self, x, y):
93 """Compute complex z=x*y, and check that z/x==y and z/y==x."""
94 z = x * y
95 if x != 0:
96 q = z / x
97 self.assertClose(q, y)
98 q = z.__truediv__(x)
99 self.assertClose(q, y)
100 if y != 0:
101 q = z / y
102 self.assertClose(q, x)
103 q = z.__truediv__(y)
104 self.assertClose(q, x)
105
106 @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: floats nan and inf are not identical
107 def test_truediv(self):

Callers 1

test_truedivMethod · 0.95

Calls 2

assertCloseMethod · 0.95
__truediv__Method · 0.45

Tested by

no test coverage detected