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

Method test_sum_stability

numpy/_core/tests/test_ufunc.py:728–733  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

726 assert_(res.dtype.name == 'float64')
727
728 def test_sum_stability(self):
729 a = np.ones(500, dtype=np.float32)
730 assert_almost_equal((a / 10.).sum() - a.size / 10., 0, 4)
731
732 a = np.ones(500, dtype=np.float64)
733 assert_almost_equal((a / 10.).sum() - a.size / 10., 0, 13)
734
735 @pytest.mark.skipif(IS_WASM, reason="fp errors don't work in wasm")
736 def test_sum(self):

Callers

nothing calls this directly

Calls 2

assert_almost_equalFunction · 0.90
sumMethod · 0.45

Tested by

no test coverage detected