Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python.announce > #1845 > unrolled thread

quicktions 1.0 - fast Fractions data type for rational numbers

Started byStefan Behnel <stefan_ml@behnel.de>
First post2015-09-10 19:06 +0200
Last post2015-09-10 19:06 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python.announce


Contents

  quicktions 1.0 - fast Fractions data type for rational numbers Stefan Behnel <stefan_ml@behnel.de> - 2015-09-10 19:06 +0200

#1845 — quicktions 1.0 - fast Fractions data type for rational numbers

FromStefan Behnel <stefan_ml@behnel.de>
Date2015-09-10 19:06 +0200
Subjectquicktions 1.0 - fast Fractions data type for rational numbers
Message-ID<mailman.359.1441954563.8327.python-announce-list@python.org>
quicktions 1.0 has been released, the cythonized version of
'fractions.Fraction'. It works with CPython 2.6 - 3.5.

Get it from PyPI:

https://pypi.python.org/pypi/quicktions


Python’s Fraction data type is an excellent way to do exact fractional and
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 fraction module:

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

Have fun!

Stefan

[toc] | [standalone]


Back to top | Article view | comp.lang.python.announce


csiph-web