Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 391 Bytes

random.md

File metadata and controls

22 lines (16 loc) · 391 Bytes

Random

Random Integer

int randomInt(int mn, int mx) {
    return mn + rand() % (mx - mn);
}

Random Double

double randomDouble(double mn, double mx) {
    double d = (double)rand() / RAND_MAX;
    return mn + d * (mx - mn);
}

Problems