X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2FDIGRand%2FDIGRand.cpp;fp=src%2FDIGRand%2FDIGRand.cpp;h=5eba39c6a3d349c13fa0992e621f0bf63751131b;hb=a1c4635385fe7ee173c79319723d1fbe5839dd52;hp=469b705ea0fa6f3f152db7ff2e0414bfede482ad;hpb=29c94e17ba096d9064f8783c41ace5d7005e5e85;p=snark14.git 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 }