Date: Tue, 27 Feb 2001 06:49:38 -0600 From: "Jacques A. Vidrine" <n@nectar.com> To: Terry Lambert <tlambert@primenet.com> Cc: Kris Kennaway <kris@FreeBSD.ORG>, arch@FreeBSD.ORG Subject: Re: rand(3) (was Re: cvs commit: ports/astro/xglobe/files patch-random) Message-ID: <20010227064938.A81525@hamlet.nectar.com> In-Reply-To: <200102270400.VAA11366@usr05.primenet.com>; from tlambert@primenet.com on Tue, Feb 27, 2001 at 04:00:22AM %2B0000 References: <20010226211804.A44846@spawn.nectar.com> <200102270400.VAA11366@usr05.primenet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 27, 2001 at 04:00:22AM +0000, Terry Lambert wrote: > The 48 bit linear congruential algorithm is a defacto standard for > the implementation across UNIX platforms. Are you sure you're not confusing rand() with System V's drand48() and family? The latter _does_ have a well-defined algorithm. > While the standards do not specify this algorithm, in practice it is > there, just as, in practice, select() does not modify the contents > of timeval, even though the man page permits it to do so, since code > would break. Yes, this is a somewhat good analogy. Thanks for your support :-) Portable applications must assume that timeout is modified. Even our own man page points out that applications should assume this. > I would be much happier if you were to quote a platform standard > instead of a language standard to permit change. I already mentioned POSIX.1 and SUSv2. rand() is also defined in SVID, where it has no set algorithm either. [snip] > Can someone put forth a use for rand() which requires this change > to permit the use to employe rand() instead of its own code? I've already posted about two (non-crypto) applications that performed poorly when using rand(), but admirably when switched to random(). This was fun, but this will have to be my last post on the subject. Cheers, -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010227064938.A81525>