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

Method test_as_integer_ratio

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

Source from the content-addressed store, hash-verified

631 self.assertFalse(F(-1, -2).is_integer())
632
633 def test_as_integer_ratio(self):
634 self.assertEqual(F(4, 6).as_integer_ratio(), (2, 3))
635 self.assertEqual(F(-4, 6).as_integer_ratio(), (-2, 3))
636 self.assertEqual(F(4, -6).as_integer_ratio(), (-2, 3))
637 self.assertEqual(F(0, 6).as_integer_ratio(), (0, 1))
638
639 def testLimitDenominator(self):
640 rpi = F('3.1415926535897932')

Callers

nothing calls this directly

Calls 3

FClass · 0.70
assertEqualMethod · 0.45
as_integer_ratioMethod · 0.45

Tested by

no test coverage detected