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

Method test_round

numpy/core/tests/test_numeric.py:170–176  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

168 assert_equal(np.reshape(arr, (2, 6)), tgt)
169
170 def test_round(self):
171 arr = [1.56, 72.54, 6.35, 3.25]
172 tgt = [1.6, 72.5, 6.4, 3.2]
173 assert_equal(np.around(arr, decimals=1), tgt)
174 s = np.float64(1.)
175 assert_(isinstance(s.round(), np.float64))
176 assert_equal(s.round(), 1.)
177
178 @pytest.mark.parametrize('dtype', [
179 np.int8, np.int16, np.int32, np.int64,

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
assert_Function · 0.90
roundMethod · 0.80

Tested by

no test coverage detected