Check out example codes for "generate random double c++". It will help you in understanding the concepts better.

Code Example 1

double fRand(double fMin, double fMax)
{
    double f = (double)rand() / RAND_MAX;
    return fMin + f * (fMax - fMin);
}

Learn ReactJs, React Native from akashmittal.com