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

Function _test_spacing

numpy/core/tests/test_umath.py:4473–4483  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

4471 assert_equal(np.nextafter(t(0), t(direction)) / t(2.1), direction * 0.0)
4472
4473def _test_spacing(t):
4474 one = t(1)
4475 eps = np.finfo(t).eps
4476 nan = t(np.nan)
4477 inf = t(np.inf)
4478 with np.errstate(invalid='ignore'):
4479 assert_equal(np.spacing(one), eps)
4480 assert_(np.isnan(np.spacing(nan)))
4481 assert_(np.isnan(np.spacing(inf)))
4482 assert_(np.isnan(np.spacing(-inf)))
4483 assert_(np.spacing(t(1e30)) != 0)
4484
4485def test_spacing():
4486 return _test_spacing(np.float64)

Callers 3

test_spacingFunction · 0.85
test_spacingfFunction · 0.85
test_spacinglFunction · 0.85

Calls 3

assert_equalFunction · 0.90
assert_Function · 0.90
tFunction · 0.85

Tested by

no test coverage detected