| 401 | |
| 402 | class TestComplexDivision: |
| 403 | def test_zero_division(self): |
| 404 | with np.errstate(all="ignore"): |
| 405 | for t in [np.complex64, np.complex128]: |
| 406 | a = t(0.0) |
| 407 | b = t(1.0) |
| 408 | assert_(np.isinf(b/a)) |
| 409 | b = t(complex(np.inf, np.inf)) |
| 410 | assert_(np.isinf(b/a)) |
| 411 | b = t(complex(np.inf, np.nan)) |
| 412 | assert_(np.isinf(b/a)) |
| 413 | b = t(complex(np.nan, np.inf)) |
| 414 | assert_(np.isinf(b/a)) |
| 415 | b = t(complex(np.nan, np.nan)) |
| 416 | assert_(np.isnan(b/a)) |
| 417 | b = t(0.) |
| 418 | assert_(np.isnan(b/a)) |
| 419 | |
| 420 | def test_signed_zeros(self): |
| 421 | with np.errstate(all="ignore"): |