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


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

quicktions 1.0 - fast Fractions data type for rational numbers

Path csiph.com!news.swapon.de!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <stefan_ml@behnel.de>
X-Original-To python-announce-list@python.org
Delivered-To python-announce-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'url:pypi': 0.03; '(python': 0.05; 'cpython': 0.05; 'received:192.168.178': 0.07; 'accelerator': 0.09; 'python': 0.10; 'from:addr:behnel.de': 0.16; 'from:addr:stefan_ml': 0.16; 'from:name:stefan behnel': 0.16; 'message-id:@behnel.de': 0.16; 'module:': 0.16; 'optimised': 0.16; 'simplicity,': 0.16; 'subject:1.0': 0.16; 'subject:type': 0.16; 'stefan': 0.18; 'library': 0.20; 'extension': 0.20; 'fraction': 0.22; 'accuracy': 0.23; 'module': 0.25; 'header:User-Agent:1': 0.26; '2.6': 0.27; 'module.': 0.27; 'decimal': 0.29; 'faster,': 0.29; 'it\xe2\x80\x99s': 0.29; 'subject:numbers': 0.29; 'compared': 0.30; 'included': 0.32; 'compiled': 0.32; 'though,': 0.32; 'url:python': 0.33; 'largely': 0.33; "skip:' 20": 0.34; 'url:org': 0.36; 'faster': 0.36; 'url:library': 0.36; 'version': 0.38; 'data': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'received:de': 0.40; 'url:3': 0.60; 'skip:\xe2 10': 0.70; 'money': 0.71; '8bit%:40': 0.72; 'beats': 0.84; 'calculations': 0.84; 'fast,': 0.84; 'safety.': 0.84; 'fun!': 0.95
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; t=1441904794; l=1043; s=domk; d=behnel.de; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:To:Subject: From; bh=Wgfhgk5HlV5hXhsE0w3YEi+nRc30BvYyoEBBPPu2yio=; b=I1quqmZJ+717pI7JE0LAQx2h4pB/ILbkmwMUqVdBdEMEPGsnENwgqykCW1KcfeEYuQX xmbZXOwZZntNoDpEEpRUBXE0FJR6CW+hqXNEo/raUJgpSar4ov5qG3/g8icBSEXjs8jUI 0JFtOJ2n8cyPYUZ0qVr6bKtkR+TP5alBdps=
X-RZG-AUTH :E1MMdFW4b++AXZOTwA41DOYM0Dv9LNWvavC/fJZqSuoXq8/b35jbpofHHhmEPNX2yd709zblYA==
X-RZG-CLASS-ID mo00
X-Mozilla-News-Host news://news.gmane.org:119
From Stefan Behnel <stefan_ml@behnel.de>
Subject quicktions 1.0 - fast Fractions data type for rational numbers
X-Enigmail-Draft-Status N1110
To python-announce-list@python.org
Date Thu, 10 Sep 2015 19:06:33 +0200
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Mailman-Approved-At Fri, 11 Sep 2015 08:56:03 +0200
X-BeenThere python-announce-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id Announcement-only list for the Python programming language <python-announce-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-announce-list/>
List-Post <mailto:python-announce-list@python.org>
List-Help <mailto:python-announce-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=subscribe>
Approved python-announce-list@python.org
Newsgroups comp.lang.python.announce
Message-ID <mailman.359.1441954563.8327.python-announce-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1441954563 news.xs4all.nl 23774 [2001:888:2000:d::a6]:51750
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python.announce:1845

Show key headers only | View raw


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

Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web