Last updated 4 years ago
Was this helpful?
int randomInt(int mn, int mx) { return mn + rand() % (mx - mn); }
double randomDouble(double mn, double mx) { double d = (double)rand() / RAND_MAX; return mn + d * (mx - mn); }