Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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+.

quicktions is an adaptation of the original fractions module (as included in CPython 3.5) 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 6x 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 fractions module:

https://docs.python.org/3.5/library/fractions.html

ChangeLog

1.5 (2017-10-22)

  • Result of power operator (**) was not normalised for negative values.
  • Built using Cython 0.27.2.

1.4 (2017-09-16)

  • Rebuilt using Cython 0.26.1 to improve support of Python 3.7.

1.3 (2016-07-24)

  • repair the faster instantiation from Decimal values in Python 3.6
  • avoid potential glitch for certain large numbers in normalisation under Python 2.x

1.2 (2016-04-08)

  • change hash function in Python 2.x to match that of fractions.Fraction

1.1 (2016-03-29)

  • faster instantiation from float values
  • faster instantiation from Decimal values in Python 3.6

1.0 (2015-09-10)

  • Fraction.imag property could return non-zero
  • parsing strings with long fraction parts could use an incorrect scale

0.7 (2014-10-09)

  • faster instantiation from float and string values
  • fix test in Python 2.x

0.6 (2014-10-09)

  • faster normalisation (and thus instantiation)

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
Release History

Release History

This version
History Node

1.5

History Node

1.4

History Node

1.3

History Node

1.2

History Node

1.1

History Node

1.0

History Node

0.7

History Node

0.6

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
quicktions-1.5-cp26-cp26m-manylinux1_i686.whl (64.9 kB) Copy SHA256 Checksum SHA256 cp26 Wheel Oct 22, 2017
quicktions-1.5-cp26-cp26m-manylinux1_x86_64.whl (76.7 kB) Copy SHA256 Checksum SHA256 cp26 Wheel Oct 22, 2017
quicktions-1.5-cp26-cp26mu-manylinux1_i686.whl (64.9 kB) Copy SHA256 Checksum SHA256 cp26 Wheel Oct 22, 2017
quicktions-1.5-cp26-cp26mu-manylinux1_x86_64.whl (76.7 kB) Copy SHA256 Checksum SHA256 cp26 Wheel Oct 22, 2017
quicktions-1.5-cp27-cp27m-manylinux1_i686.whl (66.0 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Oct 22, 2017
quicktions-1.5-cp27-cp27m-manylinux1_x86_64.whl (77.0 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Oct 22, 2017
quicktions-1.5-cp27-cp27mu-manylinux1_i686.whl (66.0 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Oct 22, 2017
quicktions-1.5-cp27-cp27mu-manylinux1_x86_64.whl (77.0 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Oct 22, 2017
quicktions-1.5-cp27-cp27m-win32.whl (47.6 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Oct 22, 2017
quicktions-1.5-cp27-cp27m-win_amd64.whl (52.7 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Oct 22, 2017
quicktions-1.5-cp33-cp33m-manylinux1_i686.whl (66.9 kB) Copy SHA256 Checksum SHA256 cp33 Wheel Oct 22, 2017
quicktions-1.5-cp33-cp33m-manylinux1_x86_64.whl (77.6 kB) Copy SHA256 Checksum SHA256 cp33 Wheel Oct 22, 2017
quicktions-1.5-cp34-cp34m-manylinux1_i686.whl (67.0 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Oct 22, 2017
quicktions-1.5-cp34-cp34m-manylinux1_x86_64.whl (77.7 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Oct 22, 2017
quicktions-1.5-cp34-cp34m-win32.whl (48.0 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Oct 22, 2017
quicktions-1.5-cp35-cp35m-manylinux1_i686.whl (67.8 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Oct 22, 2017
quicktions-1.5-cp35-cp35m-manylinux1_x86_64.whl (77.6 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Oct 22, 2017
quicktions-1.5-cp35-cp35m-win32.whl (46.6 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Oct 22, 2017
quicktions-1.5-cp35-cp35m-win_amd64.whl (53.1 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Oct 22, 2017
quicktions-1.5-cp36-cp36m-manylinux1_i686.whl (69.3 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Oct 22, 2017
quicktions-1.5-cp36-cp36m-manylinux1_x86_64.whl (79.5 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Oct 22, 2017
quicktions-1.5-cp36-cp36m-win32.whl (47.6 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Oct 22, 2017
quicktions-1.5-cp36-cp36m-win_amd64.whl (54.2 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Oct 22, 2017
quicktions-1.5.tar.gz (184.6 kB) Copy SHA256 Checksum SHA256 Source Oct 22, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting