MCPcopy
hub / github.com/numpy/numpy / test_round

Method test_round

numpy/_core/tests/test_numeric.py:226–232  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

224 np.reshape(arr_f_ord, shape, order="C", copy=False)
225
226 def test_round(self):
227 arr = [1.56, 72.54, 6.35, 3.25]
228 tgt = [1.6, 72.5, 6.4, 3.2]
229 assert_equal(np.around(arr, decimals=1), tgt)
230 s = np.float64(1.)
231 assert_(isinstance(s.round(), np.float64))
232 assert_equal(s.round(), 1.)
233
234 @pytest.mark.parametrize('dtype', [
235 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