diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-12-09 20:46:16 -0700 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-12-09 20:46:16 -0700 |
commit | fdc1c5642ecebcfbb88ce19ac8baab0b1b4ef24f (patch) | |
tree | 67102381547324921640e9c6e8ca68c5ecdeb4e5 /src/rand.c | |
parent | b5ad184c1bcef78e7c2b052bcffc71f4c7381bcb (diff) | |
download | cmath-fdc1c5642ecebcfbb88ce19ac8baab0b1b4ef24f.tar.gz cmath-fdc1c5642ecebcfbb88ce19ac8baab0b1b4ef24f.zip |
add software manual updates for hw8
Diffstat (limited to 'src/rand.c')
-rw-r--r-- | src/rand.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -1,7 +1,5 @@ #include "lizfcm.h" double rand_from(double min, double max) { - double range = (max - min); - double div = RAND_MAX / range; - return min + (rand() / div); + return min + (rand() / (RAND_MAX / (max - min))); } |