[Commits] [wesnoth/wesnoth] 059715: fix implementation bug in random number generator

GitHub noreply at github.com
Tue Apr 29 16:57:37 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 0597151f152167fb2a677e1633e4886a9435831f
      https://github.com/wesnoth/wesnoth/commit/0597151f152167fb2a677e1633e4886a9435831f
  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: 95f11ab70ba723d3fb5a75e82e5104ece62e08a5
      https://github.com/wesnoth/wesnoth/commit/95f11ab70ba723d3fb5a75e82e5104ece62e08a5
  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/7a46832348ba...95f11ab70ba7


More information about the Commits mailing list