Re: [Nolug] The real issue when dealing with bignums

From: Friedrich Gurtler <fgurtler_at_tulane.edu>
Date: Thu, 01 Jul 2004 21:59:45 -0500
Message-ID: <40E4CFA1.80703@tulane.edu>

>I think the issue here is binary->decimal/string conversion.
> $ cat bignum2.py
> import time
> t1 = time.clock()
> a = 2**80000000
> t2 = time.clock()
> print t2 - t1
>
> $ python bignum2.py
> 4.83
>

Well since its a power of 2, a decently aware algorithm would do
something like (hyper simplified)

For 2 to the N

Allocate N bits.
Set the Nth bit to 1.

Yeah, the problem is how many decimal digits does 1000000......
(2,999,999 0's)....0000 have.

___________________
Nolug mailing list
nolug@nolug.org
Received on 07/01/04

This archive was generated by hypermail 2.2.0 : 12/19/08 EST