www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/13/20:15:49

Xref: news2.mv.net comp.os.msdos.djgpp:7214
From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: rand(), random() or libg++ Random ?
Date: Tue, 13 Aug 1996 19:16:14 -0700
Organization: Three pounds of chaos and a pinch of salt
Lines: 33
Message-ID: <321136EE.67D@cs.com>
References: <1996Aug13 DOT 140921 AT uctvms DOT uct DOT ac DOT za> <4uq9mk$6g7 AT synge DOT maths DOT tcd DOT ie>
NNTP-Posting-Host: ppp220.cs.com
Mime-Version: 1.0
To: steve AT maths DOT tcd DOT ie
CC: stwand07 AT uctvms DOT uct DOT ac DOT za
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Sumo Steve wrote:
> 
> stwand07 AT uctvms DOT uct DOT ac DOT za writes:
> 
> >Hi
> 
> >1. Is random() any better?
> >2. Are the libg++ Random classes better?
> 
> >I need a normal distribution with zero mean, so 'better' refers to these
> >criteria.
> 
> 1.      nope AFAIK random is a macro which calls rand

Wrong - random() is supposedly a much better random number generator than
rand().  You seed it with srandom() instead of srand().

> 2.      libg++ does contain a random normal class, and I'd imagine
>         the quality is far superior than rand

Well, if it calls the random() algorithm to do its work, then probably
yes.  :)  However, if he's not using C++, it seems silly to start just
to get this trivial piece of functionality...

-- 
John M. Aldrich, aka Fighteer I <fighteer AT cs DOT com>

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:- a-->? c++>$ U@>++$ p>+ L>++ E>+ W+>++ N++ o+ K? w(---) O-
M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+ tv+() b+++ DI++ D++ G e(*)>++++
h!() !r !y+()
------END GEEK CODE BLOCK------

- Raw text -


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