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

Function check_real_value

numpy/core/tests/test_umath_complex.py:539–544  ·  view source on GitHub ↗
(f, x1, y1, x, exact=True)

Source from the content-addressed store, hash-verified

537
538
539def check_real_value(f, x1, y1, x, exact=True):
540 z1 = np.array([complex(x1, y1)])
541 if exact:
542 assert_equal(f(z1), x)
543 else:
544 assert_almost_equal(f(z1), x)
545
546
547def check_complex_value(f, x1, y1, x2, y2, exact=True):

Callers 4

test_cabs_inf_nanMethod · 0.85
test_simpleMethod · 0.85
test_zeroMethod · 0.85
test_special_valuesMethod · 0.85

Calls 3

assert_equalFunction · 0.90
assert_almost_equalFunction · 0.90
fFunction · 0.85

Tested by

no test coverage detected