www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/16/05:01:08

Date: Wed, 16 Feb 2000 08:51:32 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Dieter Buerssner <buers AT gmx DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: Uptime and entropy in DOS
In-Reply-To: <88btpm$128uk$3@fu-berlin.de>
Message-ID: <Pine.SUN.3.91.1000216085123.7588F-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 15 Feb 2000, Dieter Buerssner wrote:

> If the random() is used in default mode (rand_type = 3), random()
> seems to be a lagged Fibonacci RNG.

Yes.

> So, if you really need a good RNG, I would suggest to not
> use random(). You might want to do a net search on Marsaglia
> and Mersenne Twister.

`random' is actually quite good.  It is better than `rand', and with
the single exception of the birthday test, it behaves quite well.  It
might be not good enough for George Marsaglia, but I bet nobody else
will notice anything bad ;-)

Of course, if someone needs to write a multidimensional Monte-Carlo
simulation whose results will be used in safety-related applications,
then they had better used the best RNG they can get (and run their
program with several different RNGs to see the difference); these
applications *will* need the latest RNGs by Marsaglia.  I had my
share of such programs, but I doubt if many people here will need
that.

> When rand_type = 0, BSD random produces very bad random numbers
> with an alternating least significant bit.

Yes, but you can only get to this mode if you hack the sources of
`random'.

- Raw text -


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