MCPcopy Index your code
hub / github.com/python/cpython / test_compare_with_math_fsum

Method test_compare_with_math_fsum

Lib/test/test_statistics.py:1220–1225  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1218 (Decimal, Decimal("20.686"), 8))
1219
1220 def test_compare_with_math_fsum(self):
1221 # Compare with the math.fsum function.
1222 # Ideally we ought to get the exact same result, but sometimes
1223 # we differ by a very slight amount :-(
1224 data = [random.uniform(-100, 1000) for _ in range(1000)]
1225 self.assertApproxEqual(float(self.func(data)[1]), math.fsum(data), rel=2e-16)
1226
1227 def test_strings_fail(self):
1228 # Sum of strings should fail.

Callers

nothing calls this directly

Calls 3

uniformMethod · 0.80
assertApproxEqualMethod · 0.80
funcMethod · 0.45

Tested by

no test coverage detected