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

Random generator rng.next() may produce identical first number on similar parameters #167

Open
oier-namespace-std opened this issue Nov 10, 2022 · 0 comments

Comments

@oier-namespace-std
Copy link

save the code as rngtest.cpp and compile & run with the following parameter:

#include"testlib.h"
int main(int argc,char*argv[])
{
	registerGen(argc,argv,1);
	printf("%d\n",rnd.next(0,15));
}

These parameters

rngtest abc 0
rngtest abc 1
...
rngtest abc 9

will all give output 8.
And parameters

rngtest abc a
rngtest abc b
...
rngtest abc x

will all give output 10.
image

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

No branches or pull requests

1 participant