Object-oriented continued fractions with Python.
Project description
continuedfractions
A simple extension of the Python fractions
standard library for working with (finite, simple) continued fractions as Python objects.
The package is updated as necessary with improvements, features and fixes. Only standard libraries are used, and the package is supported on Python 3.10, 3.11, 3.12 and 3.13.
pip install -U 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 users interested in:
- learning about and working with (finite, simple) continued fractions as Python objects, in an intuitive object-oriented way
- exploring their key properties, such as elements/coefficients, convergents, semiconvergents, remainders, and others
- operating on them as rationals and instances of the standard library
fractions.Fraction
class - making 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 representations of or operations with continued fractions
Some - but not necessarily all - of these features may be considered for future release.
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
Built Distribution
File details
Details for the file continuedfractions-0.18.2.tar.gz
.
File metadata
- Download URL: continuedfractions-0.18.2.tar.gz
- Upload date:
- Size: 36.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f3450f617bff7c0c347dced4a77f42fc0f6c73f52327e14ab1a4e0f3e10c006 |
|
MD5 | b3b1bd7ebb388b156b743e6504c6f9e7 |
|
BLAKE2b-256 | 8f82d67e456bea8c7ee364704207126bc6a7d36234f5b956dc764171a6e71096 |
File details
Details for the file continuedfractions-0.18.2-py3-none-any.whl
.
File metadata
- Download URL: continuedfractions-0.18.2-py3-none-any.whl
- Upload date:
- Size: 38.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ce74377c4fb53f4365909cc254c76339e5b5d171ba630caf0818fa6f57bd074 |
|
MD5 | cdedddb57fcc8e6c005c6bd05697d004 |
|
BLAKE2b-256 | 36d7deae2e4417e4feeb2a5360537ae53c0065c466630a1e8eec806045fc8c6a |