Skip to main content

Fast fractions data type for rational numbers. Cythonized version of 'fractions.Fraction'.

Project description

Python’s Fraction data type is an excellent way to do exact money calculations and largely beats Decimal in terms of simplicity, accuracy and safety. Clearly not in terms of speed, though, given the cdecimal accelerator in Py3.3+.

This is an adaptation of the original fractions module (as included in CPython 3.4) that is compiled and optimised with Cython into a fast, native extension module.

Compared to the standard library ‘fractions’ module in Py2.7 and Py3.4, ‘quicktions’ is currently about 10x faster, and still about 5x faster than the current version in Python 3.5. It’s also about 15x faster than the (Python implemented) decimal module in Py2.7.

For documentation, see the Python standard library’s fraction module:


0.5 (2014-10-06)

  • faster math operations

0.4 (2014-10-06)

  • enable legacy division support in Python 2.x

0.3 (2014-10-05)

  • minor behavioural fixes in corner cases under Python 2.x (now passes all test in Py2.7 as well)

0.2 (2014-10-03)

  • cache hash value of Fractions

0.1 (2014-09-24)

  • initial public release

Project details

Download files

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

Files for quicktions, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size quicktions-0.5.tar.gz (162.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page