Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix drand48() macro.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 29 Jun 2011 13:02:46 +0000 (15:02 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 29 Jun 2011 14:02:37 +0000 (16:02 +0200)
Exclude 1.0 from the possible results, add parentheses around whole
expression, and remove spurious semicolon.

src/instr/instr_private.h

index 4f57282..842dc7f 100644 (file)
@@ -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