From: Vlad on
"Anyone who considers arithmetical methods of producing random digits
is, of course, in a state of sin."
John von Neumann.


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Stephen Howe on
> NO!!!!

Provided the re-rolls are taken care of, it should make no difference at all
whether you do modulos or division (or any other operator that maps the
integers to a smaller range with same totals for each number) _PROVIDING_
rand() is returning with the same probability all the numbers from 0 to
RAND_MAX and other statisitcal tests.

But if rand() is statistically broken then whether you use modulos or
division is academic.

Stephen Howe



[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]