icnhoukdsiih / testlib

Automatically exported from code.google.com/p/testlib
0 stars 0 forks source link

If seed < 256 for class random, then the first invocation of next() is always 5 modulo 8 #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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 Mikhail....@gmail.com on 5 Dec 2009 at 2:22