Commit 95a69be1 authored by Folkert Nobels's avatar Folkert Nobels
Browse files

Remove math error in random.h

parent 14ee9fe6
......@@ -59,7 +59,7 @@ INLINE static double random_unit_interval(const long long int id,
unsigned int seed = (id + ti_current + (long long)type) % seed_range;
/* Generate a random number between 0 and 1. */
return rand_r(&seed) / RAND_MAX_inv;
return rand_r(&seed) * RAND_MAX_inv;
}
#endif /* SWIFT_RANDOM_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment