From: Yann Duplouy Date: Mon, 21 Oct 2019 09:55:28 +0000 (+0200) Subject: Using the proper c++ way to get the min double value X-Git-Tag: v3.25~386^2~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c8784bc0f7f710ae64dcda1ef8dc6aa8bf86db8d?ds=sidebyside Using the proper c++ way to get the min double value --- diff --git a/src/xbt/random.cpp b/src/xbt/random.cpp index b0f172a290..03c544a053 100644 --- a/src/xbt/random.cpp +++ b/src/xbt/random.cpp @@ -5,6 +5,7 @@ #include "xbt/random.hpp" #include "xbt/asserts.h" +#include #include namespace simgrid { @@ -52,7 +53,7 @@ double normal(double mean, double sd) unsigned long numeratorB = mt19937_gen() - mt19937_gen.min(); unsigned long divisor = mt19937_gen.max() - mt19937_gen.min(); double u1 = numeratorA / divisor; - while (u1 < DBL_MIN) { + while (u1 < std::numeric_limits::min()) { numeratorA = mt19937_gen() - mt19937_gen.min(); u1 = numeratorA / divisor; }