Skip to content

sr-murthy/continuedfractions

CI CodeQL Analysis Codecov Ruff pdm-managed License: GPL v3 Docs PyPI version Downloads

continuedfractions

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 continuedfractions

or the main branch of this repo:

pip install -U git+https://github.com/sr-murthy/continuedfractions

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.Fraction standard 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.