[gambit-list] Computing a billion decimal digits of pi

Marc Feeley feeley at iro.umontreal.ca
Thu Jun 13 15:26:27 EDT 2013


On 2013-06-13, at 12:12 PM, Bakul Shah <bakul at bitblocks.com> wrote:

> On Thu, 13 Jun 2013 10:09:09 +0300 Mikael <mikael.rcv at gmail.com> wrote:
>>> gambit
>>> uses double the space due to portable C code.  Right there you
>>> lose a factor of two!
>> 
>> Wait, double space for what, and by what reason?
> 
> You break up a  bignum in "digits" & that you store one digit
> per word. I was told that in gambit the digit size is 32bits
> on a 64bit machine and 16its on a 32bit machine so you are
> fetching/storing at least 2N bits for an N bit bignum.
> 
> As to why, you have to ask Gambit's bignum implementor. My
> guess is it makes certain operations easier in a higher level
> language that doesn't have operators for add-with-carry,
> returning double width results etc.

Brad, correct me if I'm wrong, but the bignum "digits" are stored in as many bytes as their precision.  So there is no "factor of 2" here.

Marc




More information about the Gambit-list mailing list