delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/24/15:56:09

From: Jason Alexander <jalex AT ea DOT oac DOT uci DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Source for random()?
Date: Tue, 24 Mar 1998 11:38:41 -0800
Organization: University of California, Irvine
Lines: 13
Message-ID: <35180BC1.8AD330C1@ea.oac.uci.edu>
NNTP-Posting-Host: pv1821.pv.reshsg.uci.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

  What are the values of m,a, and c that random() uses?  (I'm assuming
it's a linear congruential random number generator, if not, please let
me know). I've looked up both rand() and random() using info, but they
don't provide the specific formula.

  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.)

Jason

- Raw text -


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