Compute complex z=x*y, and check that z/x==y and z/y==x.
(self, x, y)
| 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): |
no test coverage detected