PyMOTW: fractions – Rational Numbers

The fractions module implements a class for working with rational numbers. The Fraction class supports numerical operations for rational numbers based on the API defined by Rational in numbers.

Read more at pymotw.com: fractions