c++ random double between two values code example
Example 1: generate random double c++
double fRand(double fMin, double fMax)
{
double f = (double)rand() / RAND_MAX;
return fMin + f * (fMax - fMin);
}
Example 2: c++ random between two values
int randNum = rand()%(max-min + 1) + min;