Skip to content
Snippets Groups Projects
Commit 03582436 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Change to actually never return a value exactly on the edge of the interval

parent 1fd1c350
Branches
Tags
1 merge request!1558Sync mhd canvas before is too late
......@@ -806,8 +806,8 @@ void engine_single_force(double *dim, long long int pid,
*
* This function is *not* thread-safe.
*/
double random_uniform(double a, double b) {
return (rand() / (double)RAND_MAX) * (b - a) + a;
double random_uniform(const double a, const double b) {
return (rand() / (((double)RAND_MAX) + 1.0)) * (b - a) + a;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment