I am trying to generate random long long
numbers using this code in C++:
random_device rd;
default_random_engine gen(rd());
uniform_int_distribution<long long> distribution(1, llround(pow(10, 12)));
long long random_num = distribution(gen);
I just want to verify that this should generate random integers from [1, 10^12] uniformly. Is this the correct way to do it?
EDIT:
random_device rd;
mt19937_64 gen(rd());
uniform_int_distribution<long long> distribution(1, llround(pow(10, 12)));
long long random_num = distribution(gen);