the skew is not obvious, but it's better to write random generators this

way... slightly more enjoyable, I think.
This commit is contained in:
espie 2002-12-17 21:25:06 +00:00
parent d8afbbbb5c
commit 3cfd7b5bf6

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-circuit_c,v 1.3 2002/12/17 21:25:06 espie Exp $
--- circuit.c.orig Tue Dec 17 21:20:16 2002
+++ circuit.c Tue Dec 17 21:20:44 2002
@@ -61,7 +61,7 @@ static GTimer *timer = NULL;
static unsigned
random_number(unsigned max)
{
- return(rand() % max);
+ return(rand()/(double)RAND_MAX * max);
}
static unsigned