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

Method test_power_fast_paths

numpy/_core/tests/test_umath.py:1305–1316  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1303 assert_equal(np.power(a, b), r)
1304
1305 def test_power_fast_paths(self):
1306 # gh-26055
1307 for dt in [np.float32, np.float64]:
1308 a = np.array([0, 1.1, 2, 12e12, -10., np.inf, -np.inf], dt)
1309 expected = np.array([0.0, 1.21, 4., 1.44e+26, 100, np.inf, np.inf])
1310 result = np.power(a, 2.)
1311 assert_array_max_ulp(result, expected.astype(dt), maxulp=1)
1312
1313 a = np.array([0, 1.1, 2, 12e12], dt)
1314 expected = np.sqrt(a).astype(dt)
1315 result = np.power(a, 0.5)
1316 assert_array_max_ulp(result, expected, maxulp=1)
1317
1318
1319class TestFloat_power:

Callers

nothing calls this directly

Calls 2

assert_array_max_ulpFunction · 0.90
astypeMethod · 0.80

Tested by

no test coverage detected