Skip to content

sr-murthy/continuedfractions

Repository files navigation

continuedfractions

A simple extension of the Python fractions standard library for working with continued fractions as Python objects.

The PyPI package only uses standard libraries and can be installed on any Linux, Mac OS or Windows system supporting Python 3.10, 3.11, or 3.12.

pip install continuedfractions

See the project docs for more details, which includes the API reference.

Continued fractions are beautiful and interesting mathematical objects, with many connections in number theory and also very useful practical applications, including the rational approximation of real numbers.

The continuedfractions package is designed to:

  • make it easy to construct (finite) continued fractions as Python objects
  • explore their key properties, such as elements/coefficients, convergents, segments, remainders, and others
  • operate on them as rationals and instances of the standard library fractions.Fraction class

The project is licensed under the Mozilla Public License 2.0.