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

Method testBigFloatComparisons

Lib/test/test_fractions.py:1096–1104  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1094 self.assertFalse(F(144, -89) <= float('nan'))
1095
1096 def testBigFloatComparisons(self):
1097 # Because 10**23 can't be represented exactly as a float:
1098 self.assertFalse(F(10**23) == float(10**23))
1099 # The first test demonstrates why these are important.
1100 self.assertFalse(1e23 < float(F(math.trunc(1e23) + 1)))
1101 self.assertTrue(1e23 < F(math.trunc(1e23) + 1))
1102 self.assertFalse(1e23 <= F(math.trunc(1e23) - 1))
1103 self.assertTrue(1e23 > F(math.trunc(1e23) - 1))
1104 self.assertFalse(1e23 >= F(math.trunc(1e23) + 1))
1105
1106 def testBigComplexComparisons(self):
1107 self.assertFalse(F(10**23) == complex(10**23))

Callers

nothing calls this directly

Calls 4

assertFalseMethod · 0.80
truncMethod · 0.80
assertTrueMethod · 0.80
FClass · 0.70

Tested by

no test coverage detected