We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4cd173 commit 89fc374Copy full SHA for 89fc374
lib/node_modules/@stdlib/stats/base/dists/beta/entropy/benchmark/c/benchmark.c
@@ -76,13 +76,15 @@ static double tic( void ) {
76
}
77
78
/**
79
-* Generates a random number on the interval [0,1).
+* Generates a random number on the interval [min,max).
80
*
81
-* @return random number
+* @param min minimum value (inclusive)
82
+* @param max maximum value (exclusive)
83
+* @return random number
84
*/
-static double rand_double( void ) {
- int r = rand();
85
- return (double)r / ( (double)RAND_MAX + 1.0 );
+static double random_uniform( const double min, const double max ) {
86
+ double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
87
+ return min + ( v*(max-min) );
88
89
90
0 commit comments