| 409 | |
| 410 | class TestComplexDivision: |
| 411 | def test_zero_division(self): |
| 412 | with np.errstate(all="ignore"): |
| 413 | for t in [np.complex64, np.complex128]: |
| 414 | a = t(0.0) |
| 415 | b = t(1.0) |
| 416 | assert_(np.isinf(b / a)) |
| 417 | b = t(complex(np.inf, np.inf)) |
| 418 | assert_(np.isinf(b / a)) |
| 419 | b = t(complex(np.inf, np.nan)) |
| 420 | assert_(np.isinf(b / a)) |
| 421 | b = t(complex(np.nan, np.inf)) |
| 422 | assert_(np.isinf(b / a)) |
| 423 | b = t(complex(np.nan, np.nan)) |
| 424 | assert_(np.isnan(b / a)) |
| 425 | b = t(0.) |
| 426 | assert_(np.isnan(b / a)) |
| 427 | |
| 428 | def test_signed_zeros(self): |
| 429 | with np.errstate(all="ignore"): |