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

Method check_round

numpy/_core/tests/test_multiarray.py:2222–2228  ·  view source on GitHub ↗
(arr, expected, *round_args)

Source from the content-addressed store, hash-verified

2220
2221 def test_round(self):
2222 def check_round(arr, expected, *round_args):
2223 assert_equal(arr.round(*round_args), expected)
2224 # With output array
2225 out = np.zeros_like(arr)
2226 res = arr.round(*round_args, out=out)
2227 assert_equal(out, expected)
2228 assert out is res
2229
2230 check_round(np.array([1, 2, 3]), [1, 2, 3])
2231 check_round(np.array([1.2, 1.5]), [1, 2])

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
roundMethod · 0.80
zeros_likeMethod · 0.80

Tested by

no test coverage detected