projects
/
snark14.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use rand48()
[snark14.git]
/
src
/
DIGRand
/
DIGRand.cpp
diff --git
a/src/DIGRand/DIGRand.cpp
b/src/DIGRand/DIGRand.cpp
index 469b705ea0fa6f3f152db7ff2e0414bfede482ad..2650e4db45ed30a0675cba55a86825122d5c580c 100644
(file)
--- a/
src/DIGRand/DIGRand.cpp
+++ b/
src/DIGRand/DIGRand.cpp
@@
-1,16
+1,25
@@
-
#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
}
}