From a715dda207c1b17e81c64dd18911e80128e646f7 Mon Sep 17 00:00:00 2001 From: maartenkeijzer Date: Fri, 26 Mar 2004 09:36:07 +0000 Subject: [PATCH] Fixed rng::uniform to not provide the wrong result (1.0) once in every 2^32 times --- eo/src/utils/eoRNG.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo/src/utils/eoRNG.h b/eo/src/utils/eoRNG.h index a1bd8276..3601cf06 100644 --- a/eo/src/utils/eoRNG.h +++ b/eo/src/utils/eoRNG.h @@ -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()); } /**