From 55f0187d068e988a64fe650c660a1b19d636bea0 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 29 Jun 2011 15:02:46 +0200 Subject: [PATCH] Fix drand48() macro. Exclude 1.0 from the possible results, add parentheses around whole expression, and remove spurious semicolon. --- src/instr/instr_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.20.1