From a1c4635385fe7ee173c79319723d1fbe5839dd52 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 12 Feb 2018 11:14:00 -0700 Subject: [PATCH] Use rand48 rather than rand --- src/DIGRand/DIGRand.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 } -- 2.34.1