Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Mar 1996 15:08:51 +0300 (MSK)
From:      =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (aka Andrey A. Chernov, Black Mage) <ache@astral.msk.su>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        davidg@Root.COM, current@FreeBSD.org, imb@scgt.oz.au
Subject:   Re: random .. not so ..
Message-ID:  <199603301208.PAA00473@astral.msk.su>
In-Reply-To: <199603300629.RAA30811@godzilla.zeta.org.au> from "Bruce Evans" at "Mar 30, 96 05:29:37 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> >> >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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603301208.PAA00473>