So I am trying to get uniform random double
s using the following for my random number generation:
std::random_device rd;
std::mt19937_64 randEng(rd());
std::uniform_real_distribution<double> rg(std::numeric_limits<double>::min(), std::numeric_limits<double>::max());
and then of course calling rg(randEng)
However if I use the numeric limits of the double like this I am not getting a random sample that are from -DOUBLE to +DOUBLE. Instead I am getting numbers that are in the order of maginute e+306 or e+307 or e+308. Is there something I am doing wrong here that will not allow me to get the range that I am looking for?
If I put in something else like -10, 10 to the uniform distribution I do get valid numbers in that range. Is there something going on here for doubles that I am missing?