X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/73e3cdfbdbcdf5fb1d501f09985886c0552989d5..037217ec21:/src/xbt/random.cpp diff --git a/src/xbt/random.cpp b/src/xbt/random.cpp index beaaf21329..22d7591650 100644 --- a/src/xbt/random.cpp +++ b/src/xbt/random.cpp @@ -55,7 +55,7 @@ double uniform_real(double min, double max) } // This reuses Boost's uniform real distribution ideas - constexpr unsigned long divisor = decltype(mt19937_gen)::max() - decltype(mt19937_gen)::min(); + constexpr unsigned long divisor = decltype(mt19937_gen)::max() - decltype(mt19937_gen)::min() + 1; unsigned long numerator = mt19937_gen() - decltype(mt19937_gen)::min(); return min + (max - min) * numerator / divisor; }