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

Method test_lower_align

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

Source from the content-addressed store, hash-verified

186 assert_almost_equal(out, exp1 + 2, err_msg=msg)
187
188 def test_lower_align(self):
189 # check data that is not aligned to element size
190 # i.e doubles are aligned to 4 bytes on i386
191 d = np.zeros(23 * 8, dtype=np.int8)[4:-4].view(np.float64)
192 o = np.zeros(23 * 8, dtype=np.int8)[4:-4].view(np.float64)
193 assert_almost_equal(d + d, d * 2)
194 np.add(d, d, out=o)
195 np.add(np.ones_like(d), d, out=o)
196 np.add(d, np.ones_like(d), out=o)
197 np.add(np.ones_like(d), d)
198 np.add(d, np.ones_like(d))
199
200
201class TestPower:

Callers

nothing calls this directly

Calls 3

assert_almost_equalFunction · 0.90
viewMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected