From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.devel Subject: Re: Nearly finished (re)integrating GMP for bignums. Date: Thu, 06 Mar 2003 19:13:25 +0100 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87heb9pjni.fsf@raven.i.defaultvalue.org> <87r8adihxe.fsf@zagadka.ping.de> <87vfz6nw8i.fsf@raven.i.defaultvalue.org> <87n0k8v1u9.fsf@raven.i.defaultvalue.org> Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1046974998 16451 80.91.224.249 (6 Mar 2003 18:23:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 6 Mar 2003 18:23:18 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 06 19:23:03 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18r00M-0004B8-00 for ; Thu, 06 Mar 2003 19:22:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18r00o-0004MJ-0A for guile-devel@m.gmane.org; Thu, 06 Mar 2003 13:22:34 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18qzv1-0002ll-00 for guile-devel@gnu.org; Thu, 06 Mar 2003 13:16:35 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18qzsa-0002Bc-00 for guile-devel@gnu.org; Thu, 06 Mar 2003 13:14:05 -0500 Original-Received: from kvast.blakulla.net ([213.212.20.77]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18qzs0-00020u-00 for guile-devel@gnu.org; Thu, 06 Mar 2003 13:13:28 -0500 Original-Received: from barbara.blakulla.net ([213.212.21.238] helo=linnaeus) by kvast.blakulla.net with esmtp (Exim 3.36 #1 (Debian)) id 18qzrx-0005FN-00; Thu, 06 Mar 2003 19:13:25 +0100 Original-Received: from mdj by linnaeus with local (Exim 3.36 #1 (Debian)) id 18qzrx-0002lb-00; Thu, 06 Mar 2003 19:13:25 +0100 Original-To: Rob Browning In-Reply-To: <87n0k8v1u9.fsf@raven.i.defaultvalue.org> (Rob Browning's message of "Thu, 06 Mar 2003 11:31:26 -0600") User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 Original-cc: djurfeldt@nada.kth.se Original-cc: Marius Vollmer X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2037 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2037 Rob Browning writes: > Mikael Djurfeldt 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 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel