Date: Sun, 12 Oct 1997 14:00:26 +0200 (IST) From: Eli Zaretskii To: Nate Eldredge cc: Antonio Dias , djgpp AT delorie DOT com Subject: Re: Random numbers again... In-Reply-To: <199710100003.RAA14864@adit.ap.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 9 Oct 1997, Nate Eldredge wrote: > rand() and random() both generate random numbers, in fact > they are the same code under DJGPP. ^^^^^^^^^^^^^^^^^^^^^^ Certainly NOT!! The code of `rand' and `random' is entirely different. Even when `random' operates in its type-zero mode (and uses a linear congruental method similar to that of `rand'), it uses different constants, so the numbers come out different. But the default mode of `random' is type-3, whereby it employs the linear feedback shift register method. This is vastly superior to `rand'; in particular, the LSBs output by `random' are much more random than those produced by `rand'.