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

Method test_ufunc_casting_out

numpy/core/tests/test_regression.py:1703–1708  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1701 assert_equal(a.sum(dtype='d'), a.astype('d').sum())
1702
1703 def test_ufunc_casting_out(self):
1704 a = np.array(1.0, dtype=np.float32)
1705 b = np.array(1.0, dtype=np.float64)
1706 c = np.array(1.0, dtype=np.float32)
1707 np.add(a, b, out=c)
1708 assert_equal(c, 2.0)
1709
1710 def test_array_scalar_contiguous(self):
1711 # Array scalars are both C and Fortran contiguous

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
addMethod · 0.45

Tested by

no test coverage detected