Skip to main content

Object-oriented continued fractions with Python.

Project description

continuedfractions

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

The PyPI package is here. Only standard libraries are used, and the package 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 for:

  • working with (finite) continued fractions as Python objects
  • exploring their key properties, such as elements/coefficients, convergents, segments, remainders, and others
  • operating on them as rationals and instances of the standard library fractions.Fraction class
  • supporting approximations of and experimental computations for irrational numbers
  • exploring other related objects, such as mediants, and special sequences of rational numbers such as Farey sequences

Currently, it does not support the following features:

  • infinite and generalised continued fractions
  • symbolic computations

These are planned for future releases.

The project is licensed under the Mozilla Public License 2.0.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

continuedfractions-0.12.6.tar.gz (34.2 kB view hashes)

Uploaded Source

Built Distribution

continuedfractions-0.12.6-py3-none-any.whl (35.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page