Use rand48 rather than rand
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 12 Feb 2018 18:14:00 +0000 (11:14 -0700)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 12 Feb 2018 18:14:00 +0000 (11:14 -0700)
src/DIGRand/DIGRand.cpp

index 469b705ea0fa6f3f152db7ff2e0414bfede482ad..5eba39c6a3d349c13fa0992e621f0bf63751131b 100644 (file)
@@ -1,16 +1,26 @@
 
 #include <cstdlib>
 
 
 #include <cstdlib>
 
-//#include "DIGRand.h"
+#define USE_RAND48 1
+
+#include <stdlib.h>
 #include <DIGRand/DIGRand.h>
 
 void Srand(unsigned int pSeed)
 {
 #include <DIGRand/DIGRand.h>
 
 void Srand(unsigned int pSeed)
 {
+#if USE_RAND48
+  srand48(pSeed);
+#else
   srand(pSeed);
   srand(pSeed);
+#endif
 }
       
 double Rand(void)
 {
 }
       
 double Rand(void)
 {
+#if USE_RAND48
+  return drand48();
+#else
   return ((double) rand()) / (RAND_MAX + 1.0);
   return ((double) rand()) / (RAND_MAX + 1.0);
+#endif
 }
       
 }