X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d1a8de6d608e6a2dbfc60cf4e453832421a2fd4c..b024b9e443552c94609fc56a240cdb199a329853:/teshsuite/surf/maxmin_bench/maxmin_bench.cpp diff --git a/teshsuite/surf/maxmin_bench/maxmin_bench.cpp b/teshsuite/surf/maxmin_bench/maxmin_bench.cpp index 49df392b52..2e8704af1c 100644 --- a/teshsuite/surf/maxmin_bench/maxmin_bench.cpp +++ b/teshsuite/surf/maxmin_bench/maxmin_bench.cpp @@ -11,8 +11,6 @@ #include "xbt/sysdep.h" /* time manipulation for benchmarking */ #include "xbt/xbt_os_time.h" -#define MYRANDMAX 1000 - #include #include #include @@ -27,12 +25,13 @@ static int myrand() { static double float_random(double max) { + constexpr double MYRANDMAX = 1000.0; return ((max * myrand()) / (MYRANDMAX + 1.0)); } static unsigned int int_random(int max) { - return static_cast(((max * 1.0) * myrand()) / (MYRANDMAX + 1.0)); + return static_cast(float_random(max)); } static void test(int nb_cnst, int nb_var, int nb_elem, unsigned int pw_base_limit, unsigned int pw_max_limit,