Skip to content

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

Open
@oier-namespace-std

Description

@oier-namespace-std

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions