[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] Performance of gsl_rng_uniform_int()

From: Brian Gough
Subject: Re: [Bug-gsl] Performance of gsl_rng_uniform_int()
Date: Mon, 14 Feb 2005 16:31:01 +0000

Markus Armbruster writes:
 > I remember enough math to be adequately cautious with PRNGs.  I may
 > overlook something deep, but isn't
 >    (unsigned long)(gsl_rng_uniform (r) * n)
 > a perfectly fine way to get uniformely distributed integers from 0 to
 > n-1 inclusive?

The distribution is technically not uniform if the range of r is not a
multiple of n.


Brian Gough

reply via email to

[Prev in Thread] Current Thread [Next in Thread]