A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2007-October/074941.html below:

[Python-Dev] C Decimal - is there any interest?

[Python-Dev] C Decimal - is there any interest? [Python-Dev] C Decimal - is there any interest?Mateusz Rukowicz mateusz.rukowicz at vp.pl
Tue Oct 16 18:55:31 CEST 2007
Mark Dickinson wrote:

>I'm almost sure that adding 40000 digit numbers together is not what
>Decimal was intended to be used for, but it still seems unreasonable
>that it takes almost 5 seconds to do such an addition.  The reason for
>the quadratic behaviour is that almost all the arithmetic routines in
>decimal.py, at some point, convert the coefficient of their
>argument(s) from a tuple of digits to a Python integer, and then do
>the reverse conversion to get a Decimal result;  both of these
>conversions (tuple of digits <-> integer) take time quadratic in the
>size of the tuple/integer.   This means that multiplication of
>Decimals is also quadratic time, even though it makes use of Python's
>subquadratic Karatsuba multiplication.
>  
>
Oh right, my mistake :> -- I looked at python code, but I forgot about 
conversion ;).

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4