Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Jun 3, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant