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

Method test_sum_stability

numpy/core/tests/test_ufunc.py:698–703  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

696 assert_(res.dtype.name == 'float64')
697
698 def test_sum_stability(self):
699 a = np.ones(500, dtype=np.float32)
700 assert_almost_equal((a / 10.).sum() - a.size / 10., 0, 4)
701
702 a = np.ones(500, dtype=np.float64)
703 assert_almost_equal((a / 10.).sum() - a.size / 10., 0, 13)
704
705 @pytest.mark.skipif(IS_WASM, reason="fp errors don't work in wasm")
706 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