Fast conversion of numbers to numerator/denominator pairs

Tim Delaney timothy.c.delaney at gmail.com
Sat Aug 24 18:05:50 EDT 2013


On 25 August 2013 07:59, Tim Delaney <timothy.c.delaney at gmail.com> wrote:

> Breakdown of the above (for 19 digits):
>
> d.as_tuple() takes about 35% of the time.
>
> The multiply and add takes about 55% of the time.
>
> The exponentiation takes about 10% of the time.
>

Bah - sent before complete.

Since the multiply and add takes such a significant proportion of the time,
compiling the above with Cython should gain you a big win as well. Or find
some other way to turn that loop into native code.

Tim Delaney
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130825/2992a120/attachment.html>


More information about the Python-list mailing list