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 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
The documentation provides more detailed information on aspects of the package libraries and their implementation.