Another thing to try: Rat.py from the demo folder in the Python 2.5 maintenance branch. If I understand correctly, this is dad 2.6 fractions . This is the only module without dependencies.
>>> from Rat import rat >>> rat(1) / rat(3) Rat(1,3) >>> rat(1, 3) ** 2 Rat(1,9)
UPDATE : Nah, fractions.py for my task is about 2.5 times faster.
Constantin
source share