From owner-freebsd-arch Sun Feb 25 8:26:42 2001 Delivered-To: freebsd-arch@freebsd.org Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by hub.freebsd.org (Postfix) with ESMTP id 55EE837B401 for ; Sun, 25 Feb 2001 08:26:39 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.11.2/8.11.2) id f1PGQAe39000; Sun, 25 Feb 2001 08:26:10 -0800 (PST) (envelope-from sgk) From: Steve Kargl Message-Id: <200102251626.f1PGQAe39000@troutmask.apl.washington.edu> Subject: Re: cvs commit: ports/astro/xglobe/files patch-random In-Reply-To: <20010225005813.A29124@mollari.cthul.hu> from Kris Kennaway at "Feb 25, 2001 00:58:13 am" To: Kris Kennaway Date: Sun, 25 Feb 2001 08:26:10 -0800 (PST) Cc: arch@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Kris Kennaway wrote: > On Sun, Feb 25, 2001 at 09:52:40AM +0100, Erik Trulsson wrote: > > > No, the algorithm of rand() is not standardized in the C standard. > > > > OTOH, there is an example of a portable implementation of rand() in the > > C standard and FreeBSD uses the same algorithm (as does many other > > implementations of rand()). This is probably what you were thinking of. > > > > As long as rand() and srand() behaves as describe in the man-page for > > rand(3) they confirm to the C standard. (Provided that RAND_MAX is at > > least 32767.) > > That's good to know. I'll look at replacing it with something better > that has the same semantics, so we solve this problem at the source. > > Kris Kris, If you're looking for a candidate algorithm, you might consider the Mersenne Twister (MT). http://www.math.keio.ac.jp/~matumoto/emt.html MT is for Monte Carlos type work. It isn't crypto strong. -- Steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message