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

Method test_modular_power

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

Source from the content-addressed store, hash-verified

268 assert_almost_equal(result, 9, err_msg=msg)
269
270 def test_modular_power(self):
271 # modular power is not implemented, so ensure it errors
272 a = 5
273 b = 4
274 c = 10
275 expected = pow(a, b, c) # noqa: F841
276 for t in (np.int32, np.float32, np.complex64):
277 # note that 3-operand power only dispatches on the first argument
278 assert_raises(TypeError, operator.pow, t(a), b, c)
279 assert_raises(TypeError, operator.pow, np.array(t(a)), b, c)
280
281
282def floordiv_and_mod(x, y):

Callers

nothing calls this directly

Calls 3

assert_raisesFunction · 0.90
powFunction · 0.85
tFunction · 0.85

Tested by

no test coverage detected