"Andrey A. Chernov" writes:
> On Mon, Feb 03, 2003 at 00:17:35 +1100, Tim Robbins wrote:
> > 
> > I believe that this change just moves the "bad" seed to 123459876; after
> > calling srand() with that seed, each call to rand() returns 0.
> Yes. Nothing better is possible for this formulae and this is documented
> in algorithm, some value must be excluded. Excluding 0 is bad only because
> srand(0) is commonly used and srand(123459876) is not.

This means that this routine has a chance of failing spectacularly.

We should not use it.

> Ragarding to old formulae, the question is: what is worse, generate 
> non-random lover bits everytime (old variant) or exclude one seed value 
> (new variant)?

Neither. New RNG is needed.

> Of course formulae can be changed to some another algorithm, but keep in 
> mind that rand() must be simple and speedy. Now used variant is most 
> simpler, others are much more complex.

RC4 is fast. RC4 is simple. Any objections? :-)

Mark Murray
iumop ap!sdn w,I idlaH

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to