changeset 315:60543c769ff2

profile: Fixed weighted randomness generation.
author Timo Sirainen <tss@iki.fi>
date Fri, 11 Oct 2013 19:46:06 +0300
parents 85763021565c
children 4ec03f56e053
files src/profile.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/profile.c	Thu Oct 10 17:39:46 2013 +0300
+++ b/src/profile.c	Fri Oct 11 19:46:06 2013 +0300
@@ -19,7 +19,7 @@
 #define RANDN2(mu, sigma) \
 	(mu + (rand()%2 ? -1.0 : 1.0) * sigma * pow(-log(0.99999*RANDU), 0.5))
 #define weighted_rand(n) \
-	(int)RANDN2(n, 1.0)
+	(int)RANDN2(n, n/2)
 
 static void user_set_timeout(struct user *user);