Getting Started#

This is a PyPI package which uses only Python standard libraries, and is supported on any Linux, Mac OS or Windows system supporting Python 3.10, 3.11, or 3.12. It is CI-tested on Ubuntu Linux (22.04.3 LTS), Mac OS (12.7.3) and Windows (Windows Server 2022), but should also install on any other platform supporting these Python versions.

Installation#

A standard pip install is sufficient:

pip install continuedfractions

Potential contributors may want look at the project TOML, and then the contributions overview.

Package Structure#

The continuedfractions package consists of two core libraries.

Each is summarised below. Or you can go straight to the API reference.

continuedfractions.lib#

This is a library of standalone functions, the most important of which are summarised below.

Note

There are also two “wrapper” functions for computing left- and right-mediants - left_mediant() and right_mediant() - but these just call mediant().

continuedfractions.continuedfraction#

This is a library containing a single main class:

  • ContinuedFraction - a subclass of fractions.Fraction, designed to represent (finite) simple continued fractions as Python objects, which are fully operable as rational numbers.