[Commits] [wesnoth/wesnoth] b636f3: fix implementation bug in random number generator
GitHub
noreply at github.com
Tue Apr 29 16:49:27 UTC 2014
Branch: refs/heads/1.12
Home: https://github.com/wesnoth/wesnoth
Commit: b636f3c9715d4a795df82a4435c2e5a8def81e3c
https://github.com/wesnoth/wesnoth/commit/b636f3c9715d4a795df82a4435c2e5a8def81e3c
Author: Chris Beck <render787 at gmail.com>
Date: 2014-04-29 (Tue, 29 Apr 2014)
Changed paths:
M src/simple_rng.hpp
Log Message:
-----------
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.
Commit: 012fc3de164c8d4db09dfd13ca21599eed9008a6
https://github.com/wesnoth/wesnoth/commit/012fc3de164c8d4db09dfd13ca21599eed9008a6
Author: Chris Beck <render787 at gmail.com>
Date: 2014-04-29 (Tue, 29 Apr 2014)
Changed paths:
M changelog
Log Message:
-----------
update changelog
Compare: https://github.com/wesnoth/wesnoth/compare/f320a1efa4a2...012fc3de164c
More information about the Commits
mailing list