aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--randtest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/randtest.c b/randtest.c
index 544fc88..710377f 100644
--- a/randtest.c
+++ b/randtest.c
@@ -27,7 +27,7 @@ static unsigned rand_to_max(unsigned max)
while ((random = rand()) == (double)RAND_MAX);
- return random / (double)RAND_MAX * (double)(max + 1);
+ return random / (double)RAND_MAX * (double)max;
}
int main(int argc, char **argv)