[gameprogrammer] Re: Random Integer Problem :(

  • From: "Chris Nystrom" <cnystrom@xxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sun, 24 Sep 2006 05:10:09 -0500

On 9/24/06, Olivier Delannoy <olivier.delannoy@xxxxxxxxx> wrote:

If anyone has a better explanation (which is not going to be really
hard) or a better way to highlight the benefits of one method over the
other,  I would be really pleased to read of it here.


From reading the man page it appears that in older implementations the lower order bits are not as random as the higher order bits and so the problem with modulus method is that it uses the (less random) lower-order bits.

However, the man page also says that in the modern implementation this has
been fixed, so I presume that the modulus method would now be just be just
as effective (and simpler), which may be why your experiment did not show a
difference.

Chris

--
E-Mail: Chris Nystrom <cnystrom@xxxxxxxxx>
http://www.newio.org/
AIM: nystromchris

Other related posts: