www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/25/14:28:06

Message-ID: <3518D3ED.208A@pobox.oleane.com>
Date: Wed, 25 Mar 1998 10:52:45 +0100
From: Francois Charton <deef AT pobox DOT oleane DOT com>
Organization: CCMSA
MIME-Version: 1.0
To: Jason Alexander <jalex AT ea DOT oac DOT uci DOT edu>
CC: djgpp AT delorie DOT com
Subject: Re: Source for random()?
References: <35180BC1 DOT 8AD330C1 AT ea DOT oac DOT uci DOT edu>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019