Fixed rng::uniform to not provide the wrong result (1.0) once in every 2^32 times

This commit is contained in:
maartenkeijzer 2004-03-26 09:36:07 +00:00
commit a715dda207

View file

@ -151,7 +151,7 @@ public :
*/
double uniform(double m = 1.0)
{ // random number between [0, m]
return m * double(rand()) / double(rand_max());
return m * double(rand()) / double(1.0+rand_max());
}
/**