fix implementation bug in random number generator

Our simple_rng is described in comments (in .cpp file) as coming
from a desription in man pages, man rand(3). Here is a link to
that page:

http://linux.die.net/man/3/rand

Our implementation did not match the specification, because the
rand_pool_ variable was an unsigned int and not an unsigned long.

Since the rand_pool_ should basically be constantly overflowing
under normal operation of the rng, it is obvious to me that this
would affect the long term random results. It is not at all obvious
to me whether significant bias or defect would be introduced... but
it would not be surprising either.
This commit is contained in:
Chris Beck 2014-04-29 12:42:48 -04:00
parent 7a46832348
commit 0597151f15

View File

@ -56,7 +56,7 @@ private:
int random_seed_;
/** State for the random pool (modulo arithmetic). */
unsigned random_pool_;
unsigned long random_pool_;
/** Number of time a random number is generated. */
unsigned random_calls_;