Calculate Big Number

Tomasz Rola rtomek at ceti.pl
Tue Jan 8 01:59:23 CET 2013


On Tue, 8 Jan 2013, Nac Temha wrote:

> Hello,
> How to *quickly* calculate large numbers. For example
> >>> (10**25) * (2**50)
> 11258999068426240000000000000000000000000L
> 

Um, Karatsuba multiplication?

http://en.wikipedia.org/wiki/Karatsuba_algorithm

Or see what GMP folks are doing:

http://en.wikipedia.org/wiki/GNU_Multi-Precision_Library

Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.      **
** As the answer, master did "rm -rif" on the programmer's home    **
** directory. And then the C programmer became enlightened...      **
**                                                                 **
** Tomasz Rola          mailto:tomasz_rola at bigfoot.com             **



More information about the Python-list mailing list