From 6e2ba427f90cb8e6227f4ecca0e5fc3ca53cc693 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 3 Oct 2011 19:20:46 +1100 Subject: [PATCH] Correctly bias the range::random function with min --- range.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/range.cpp b/range.cpp index ced93822..0953cb16 100644 --- a/range.cpp +++ b/range.cpp @@ -78,7 +78,7 @@ template T range::random (void) const { double pos = ::rand () / (double)(RAND_MAX); - return (max - min) * pos; + return (max - min) * pos + min; }