[issue1811] True division of integers could be more accurate

Mark Dickinson report at bugs.python.org
Wed Dec 23 16:33:53 CET 2009


Mark Dickinson <dickinsm at gmail.com> added the comment:

Here's an updated patch, against py3k.  On my machine, a/b is a touch faster with this patch when abs(a), 
abs(b) are smaller than 1e15 or so;  it's (inevitably) slower than the existing implementation for larger a 
and b.  For 'random' a and b, average running time is proportional to the size of b, and is independent of 
the size of a;  worst-case running time (which occurs when a has many trailing zero bits) grows as 
max(size(a), size(b)).

Changing versions to 2.7 and 3.2, but I'm mostly aiming for 3.2.  It may not be worth backporting to 2.7, 
given the extra effort required to deal correctly with ints as well as with longs.

----------
stage:  -> patch review
versions: +Python 2.7, Python 3.2 -Python 2.6, Python 3.0
Added file: http://bugs.python.org/file15667/long_division2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1811>
_______________________________________


More information about the Python-bugs-list mailing list