On Sun, Feb 02, 2003 at 01:11:06 -0800, Kris Kennaway wrote:
> 
> Another problem (noticed by tjr) is that once the sequence hits '0' it
> jumps to INT_MAX and stays there forever.  For example, seeding with
> srand(0) produces nothing but INT_MAX from rand().
> 
> It looks like a lot more validation of this PRNG is needed.

Don't have an idea about this thing yet, maybe some sign or variable size 
change fix required.

BTW, note that new formulae also used in the kernel (by BSD developers)
and taken from there - libkern/random.c - so all you say is true there
too.

-- 
Andrey A. Chernov
http://ache.pp.ru/

Attachment: msg51495/pgp00000.pgp
Description: PGP signature

Reply via email to