Mail Archives: djgpp/1996/08/13/20:15:49
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 -