A simple extension of the Python fractions.Fraction standard library class for working with (finite, simple) continued fractions as Python objects.
Install from PyPI:
pip install -U continuedfractionsor the main branch of this repo:
pip install -U git+https://github.com/sr-murthy/continuedfractionsThe documentation now consists only of an API reference. All other previous documentation has been removed to reduce maintenance.
The continuedfractions package is aimed at users interested in:
- working with (finite, simple) continued fractions as Python objects, in an intuitive object-oriented way
- making stateful computations involving key properties such as elements/coefficients, convergents, semiconvergents, remainders, and others
- operating on them as rationals and instances of the
fractions.Fractionstandard library class - testing approximations for irrational numbers
- exploring other related objects such as rational points in the plane, enumerations of rational numbers, mediants, and special sequences of rational numbers such as Farey sequences