MCPcopy Create free account
hub / github.com/numpy/numpy / test_zero_division

Method test_zero_division

numpy/core/tests/test_scalarmath.py:403–418  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

401
402class 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"):

Callers

nothing calls this directly

Calls 2

assert_Function · 0.90
tFunction · 0.85

Tested by

no test coverage detected