MCPcopy Index your code
hub / github.com/numpy/numpy / test_fabs

Method test_fabs

numpy/_core/tests/test_umath_complex.py:427–439  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

425 assert_almost_equal(y, y_r)
426
427 def test_fabs(self):
428 # Test that np.abs(x +- 0j) == np.abs(x) (as mandated by C99 for cabs)
429 x = np.array([1 + 0j], dtype=complex)
430 assert_array_equal(np.abs(x), np.real(x))
431
432 x = np.array([complex(1, ncu.NZERO)], dtype=complex)
433 assert_array_equal(np.abs(x), np.real(x))
434
435 x = np.array([complex(np.inf, ncu.NZERO)], dtype=complex)
436 assert_array_equal(np.abs(x), np.real(x))
437
438 x = np.array([complex(np.nan, ncu.NZERO)], dtype=complex)
439 assert_array_equal(np.abs(x), np.real(x))
440
441 def test_cabs_inf_nan(self):
442 x, y = [], []

Callers

nothing calls this directly

Calls 2

assert_array_equalFunction · 0.90
realMethod · 0.80

Tested by

no test coverage detected