MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_sumprod_accuracy

Method test_sumprod_accuracy

Lib/test/test_math.py:1395–1400  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1393 "sumprod() accuracy not guaranteed on machines with double rounding")
1394 @support.cpython_only # Other implementations may choose a different algorithm
1395 def test_sumprod_accuracy(self):
1396 sumprod = math.sumprod
1397 self.assertEqual(sumprod([0.1] * 10, [1]*10), 1.0)
1398 self.assertEqual(sumprod([0.1] * 20, [True, False] * 10), 1.0)
1399 self.assertEqual(sumprod([True, False] * 10, [0.1] * 20), 1.0)
1400 self.assertEqual(sumprod([1.0, 10E100, 1.0, -10E100], [1.0]*4), 2.0)
1401
1402 @support.requires_resource('cpu')
1403 def test_sumprod_stress(self):

Callers

nothing calls this directly

Calls 2

sumprodFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected