testlib
testlib copied to clipboard
If seed < 256 for class random, then the first invocation of next() is always 5 modulo 8
Such program
for (int i = 0; i <= 300; ++i) {
random rnd;
rnd.setSeed(i);
if (rnd.next(8) != 5) {
cerr << i << endl;
}
}
Outputs
256
257
258
...
300
Original issue reported on code.google.com by [email protected] on 5 Dec 2009 at 2:22