Add rational.Rational as an implementation of numbers.Rational with infinite
precision. This has been discussed at http://bugs.python.org/issue1682. It's useful primarily for teaching, but it also demonstrates how to implement a member of the numeric tower, including fallbacks for mixed-mode arithmetic. I expect to write a couple more patches in this area: * Rational.from_decimal() * Rational.trim/approximate() (maybe with different names) * Maybe remove the parentheses from Rational.__str__() * Maybe rename one of the Rational classes * Maybe make Rational('3/2') work.
Showing
Demo/classes/Rat.py
deleted
100755 → 0
Doc/library/rational.rst
0 → 100644
Lib/rational.py
0 → 100755
This diff is collapsed.
Lib/test/test_rational.py
0 → 100644
This diff is collapsed.
Please register or sign in to comment