
please wait
|
|
rand()
and srand()
before jumping into more advanced PRNGs(pseudo random number generators).std::random_device
is a generator for a "random" number. It is supposed to be a "true random" number generator and I don't think is supported on some compilers. std::default_random_engine generator
is another PRNG which takes a seed as a constructor. So basically you are picking a random number to see this generator. std::uniform_real_distribution<double>
This is just a uniform distribution which makes it so that each "random" number will appear equally likely each time it is called.