JacksEscape/util/rand.c
2024-03-26 13:54:32 +08:00

15 lines
241 B
C

#include "rand.h"
#include <stdlib.h>
double rand_Double01() {
// Very bad implementation.
return ((double)rand()) / (double)RAND_MAX;
}
double rand_DoubleRange(double min, double max) {
return min + rand_Double01() * (max - min);
}