I have the following:
std::random_device rd;
std::mt19937_64 randEng(rd());
std::uniform_real_distribution<double> rg(std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max());
for(size_t i = 0; i < numToGenerate; i++){
nums[i] = rg(randEng);
std::cout << nums[i] << std::endl;
}
Where numsis the vector given fornumToGenerate
Every number that is printed says inf, I realized that I set this to get random numbers between them in this case -1.79769e+308and 1.79769e+308, as it happens on my machine. What am I doing wrong here in setting up this random number generator
source
share