Date: Mon, 3 Feb 2003 02:29:47 -0800 (PST) From: "Andrey A. Chernov" <ache@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/libkern random.c Message-ID: <200302031029.h13ATmVi027137@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
ache 2003/02/03 02:29:47 PST Modified files: sys/libkern random.c Log: Park & Miller PRNG can be safely initialized with any value but 0 and stuck at 0 as designed. Its BSD adaptation tries to fight it by mapping 0 to 2147483647 after calculation, but this method not works since 2147483647 seed returns to 0 again on the next interation. Instead of after calculation mapping, map 0 to another value _before_ calculation, so it never stucks. Revision Changes Path 1.8 +4 -2 src/sys/libkern/random.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302031029.h13ATmVi027137>