Message-ID: <3518D3ED.208A@pobox.oleane.com> Date: Wed, 25 Mar 1998 10:52:45 +0100 From: Francois Charton Organization: CCMSA MIME-Version: 1.0 To: Jason Alexander CC: djgpp AT delorie DOT com Subject: Re: Source for random()? References: <35180BC1 DOT 8AD330C1 AT ea DOT oac DOT uci DOT edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Jason Alexander wrote: > > Also, does anyone have an (informed) opinion on which of the two > generators is better? (Where "better" is understood in terms of the > theoretical and empirical tests described in Knuth vol. 2. I know all > linear congruential generators eventually fail the spectral test, but I > was wondering which of rand() and random() perform better.) > random() is known to avoid some of the problems with linear congruential generators, such as rand(). In this respect, it can be seen as the better one. Note however that linear congruential algorithms are the RNG which have been most researched. So, their flaws are better known than those of other algorithms. A problem you may encounter when relying on different algorithms, like that of random(), is that many of its weaknesses are still unknown. A good point for rand() is that when you use it, you know better where you stand. Regards, Francois