aboutsummaryrefslogtreecommitdiff
path: root/src/stable/randombasic.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-11-09 18:15:04 +0000
committerMike Buland <eichlan@xagasoft.com>2012-11-09 18:15:04 +0000
commit79843b51267d7a8faf8e9dcee09fa5e167373e6d (patch)
treecc317f202fa6b7b68908af9bee1848355681db78 /src/stable/randombasic.cpp
parentba177923d7b60800ae2e01f80fc10dc8ad1594bb (diff)
downloadlibbu++-79843b51267d7a8faf8e9dcee09fa5e167373e6d.tar.gz
libbu++-79843b51267d7a8faf8e9dcee09fa5e167373e6d.tar.bz2
libbu++-79843b51267d7a8faf8e9dcee09fa5e167373e6d.tar.xz
libbu++-79843b51267d7a8faf8e9dcee09fa5e167373e6d.zip
Added seed parameter to constructor of two PRNGs. Also fixed horrible mistake
in RandomBasic.
Diffstat (limited to '')
-rw-r--r--src/stable/randombasic.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/stable/randombasic.cpp b/src/stable/randombasic.cpp
index e253b70..fe8843b 100644
--- a/src/stable/randombasic.cpp
+++ b/src/stable/randombasic.cpp
@@ -7,10 +7,11 @@
7 7
8#include "bu/randombasic.h" 8#include "bu/randombasic.h"
9 9
10Bu::RandomBasic::RandomBasic() : 10#define a (6364136223846793005ll)
11 a( 6364136223846793005ll ), 11#define c (1442695040888963407ll)
12 c( 1442695040888963407ll ), 12
13 x( 0 ) 13Bu::RandomBasic::RandomBasic( int32_t iSeed ) :
14 x( iSeed )
14{ 15{
15} 16}
16 17
@@ -20,7 +21,7 @@ Bu::RandomBasic::~RandomBasic()
20 21
21void Bu::RandomBasic::seed( int32_t iSeed ) 22void Bu::RandomBasic::seed( int32_t iSeed )
22{ 23{
23 c = iSeed; 24 x = iSeed;
24} 25}
25 26
26int32_t Bu::RandomBasic::rand() 27int32_t Bu::RandomBasic::rand()