guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Nearly finished (re)integrating GMP for bignums.


From: Mikael Djurfeldt
Subject: Re: Nearly finished (re)integrating GMP for bignums.
Date: Thu, 06 Mar 2003 19:13:25 +0100
User-agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2

Rob Browning <address@hidden> writes:

> Mikael Djurfeldt <address@hidden> writes:
>
>> It does this by allocating a bignum b with as many base 65536 digits
>> as m, filling b with random bits (in 32 bit chunks) up to the most
>> significant 1 in m, and, finally checking if the resultant b is too
>> large (>= m).  If too large, we simply repeat the process again.
>> (It is important to throw away all generated random bits if b >= m,
>> otherwise we'll end up with a distorted distribution.)
>
> It looks like the old code handled 16-bit chunks at a time.  I just
> wanted to make sure it was OK to go ahead and use the full "unsigned
> long" random_bits range per-chunk instead if that works out better.

No, in fact, the old code also used all 32 random bits a long word at
a time.  And, yes, that should be OK with our RNG.

M




reply via email to

[Prev in Thread] Current Thread [Next in Thread]