From: Kevin M. Rosenberg Date: Mon, 12 Feb 2018 18:14:00 +0000 (-0700) Subject: Use rand48 rather than rand X-Git-Url: http://git.kpe.io/?p=snark14.git;a=commitdiff_plain;h=a1c4635385fe7ee173c79319723d1fbe5839dd52 Use rand48 rather than rand --- diff --git a/src/DIGRand/DIGRand.cpp b/src/DIGRand/DIGRand.cpp index 469b705..5eba39c 100644 --- a/src/DIGRand/DIGRand.cpp +++ b/src/DIGRand/DIGRand.cpp @@ -1,16 +1,26 @@ #include -//#include "DIGRand.h" +#define USE_RAND48 1 + +#include #include void Srand(unsigned int pSeed) { +#if USE_RAND48 + srand48(pSeed); +#else srand(pSeed); +#endif } double Rand(void) { +#if USE_RAND48 + return drand48(); +#else return ((double) rand()) / (RAND_MAX + 1.0); +#endif }