star-sp

Random number generators and distributions
git clone git://git.meso-star.fr/star-sp.git
Log | Files | Refs | README | LICENSE

commit 2daff223318e73c2f763dfd8f3582a04e98a341e
parent 054a3047f0239db55b9ee6582b4318e25c6feacc
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Thu,  4 Feb 2016 12:31:20 +0100

BugFix: rng_kiss_uniform_uint64 wrong cast to uint32_t

Diffstat:
Msrc/ssp_rng.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ssp_rng.c b/src/ssp_rng.c @@ -126,7 +126,7 @@ static uint64_t rng_kiss_uniform_uint64(void* data, const uint64_t lower, const uint64_t upper) { ASSERT(lower <= upper); - return (uint32_t) + return (uint64_t) ( (double)rng_kiss_get(data)/(double)UINT32_MAX * (double)(upper - lower) + (double)lower); }