From owner-freebsd-current Sat Mar 30 04:29:33 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id EAA04386 for current-outgoing; Sat, 30 Mar 1996 04:29:33 -0800 (PST) Received: from sequent.kiae.su (sequent.kiae.su [144.206.136.6]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id EAA04380 for ; Sat, 30 Mar 1996 04:29:23 -0800 (PST) Received: by sequent.kiae.su id AA14163 (5.65.kiae-2 ); Sat, 30 Mar 1996 15:24:08 +0300 Received: by sequent.KIAE.su (UUMAIL/2.0); Sat, 30 Mar 96 15:24:08 +0300 Received: (from ache@localhost) by astral.msk.su (8.7.5/8.7.3) id PAA00473; Sat, 30 Mar 1996 15:08:51 +0300 (MSK) Message-Id: <199603301208.PAA00473@astral.msk.su> Subject: Re: random .. not so .. To: bde@zeta.org.au (Bruce Evans) Date: Sat, 30 Mar 1996 15:08:51 +0300 (MSK) Cc: davidg@Root.COM, current@FreeBSD.org, imb@scgt.oz.au In-Reply-To: <199603300629.RAA30811@godzilla.zeta.org.au> from "Bruce Evans" at "Mar 30, 96 05:29:37 pm" From: =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (aka Andrey A. Chernov, Black Mage) X-Class: Fast X-Mailer: ELM [version 2.4ME+ PL14 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > >> >I plan to aply proposed fix, if nobody against. > > It needs more thought. What thought exactly do you mean? > rand() is well known to be poor and is left that way for historical bug > for bug compatibility. srandom() uses the same formula as rand() so it I think, nothing wrong happens if even rand() will be better. All rand() using programs I see still expects 'random generator' from it and not 'well-known historycal buggy formula'. > may be poor. This seems to be the main point of the fix. The example > program seems to be mostly bogus. Calling srandom() a lot defeats the > randomness of random(). For a sillier example, change the constants in Calling srandom(time() f.e.) is common case. Without this fix two programs calling srandom in _different_ times produces very predictable almost same sequences. -- Andrey A. Chernov : And I rest so composedly, /Now, in my bed, ache@astral.msk.su : That any beholder /Might fancy me dead - http://dt.demos.su/~ache : Might start at beholding me, /Thinking me dead. RELCOM Team,FreeBSD Team : E.A.Poe From "For Annie" 1849