projects
/
snark14.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
29c94e1
)
Use rand48 rather than rand
author
Kevin M. Rosenberg
<kevin@rosenberg.net>
Mon, 12 Feb 2018 18:14:00 +0000
(11:14 -0700)
committer
Kevin M. Rosenberg
<kevin@rosenberg.net>
Mon, 12 Feb 2018 18:14:00 +0000
(11:14 -0700)
src/DIGRand/DIGRand.cpp
patch
|
blob
|
history
diff --git
a/src/DIGRand/DIGRand.cpp
b/src/DIGRand/DIGRand.cpp
index 469b705ea0fa6f3f152db7ff2e0414bfede482ad..5eba39c6a3d349c13fa0992e621f0bf63751131b 100644
(file)
--- a/
src/DIGRand/DIGRand.cpp
+++ b/
src/DIGRand/DIGRand.cpp
@@
-1,16
+1,26
@@
#include <cstdlib>
-//#include "DIGRand.h"
+#define USE_RAND48 1
+
+#include <stdlib.h>
#include <DIGRand/DIGRand.h>
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
}