From: Arnaud Giersch Date: Wed, 29 Jun 2011 13:02:46 +0000 (+0200) Subject: Fix drand48() macro. X-Git-Tag: v3_6_2~203^2~9 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/55f0187d068e988a64fe650c660a1b19d636bea0?hp=0efb8571388c3eed6e4de86a9e1f1dbc5d388ab2 Fix drand48() macro. Exclude 1.0 from the possible results, add parentheses around whole expression, and remove spurious semicolon. --- diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 4f57282d5b..842dc7fd2a 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -13,7 +13,7 @@ /* Need to define function drand48 for Windows */ #ifdef _WIN32 - #define drand48() rand()/(float)(RAND_MAX); +# define drand48() (rand()/(RAND_MAX + 1.0)) #endif #define INSTR_DEFAULT_STR_SIZE 500