[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Uniform Random Number Generator

Rick DeNatale

5/22/2007 7:54:00 PM

On 5/22/07, Roland Mai <roland.mai@gmail.com> wrote:
> I need a random number generator that generates random numbers with a
> uniform distribution.
>
> I am not sure what rand does in ruby and I can't seem to find it online
> either. My initial assumption is that it follows a uniform distribution, but
> I can't tell.
>
> Any ideas?
>

According to the source code for random.c, Ruby's implementation of
rand uses the Mersenne Twister MT19937 which according to:
http://en.wikipedia.org/wiki/Mersen... has "a very high order
of dimensional equidistribution."

HTH

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denh...