Skip to content

Commit 89fc374

Browse files
fix: bench errors
1 parent f4cd173 commit 89fc374

File tree

1 file changed

+7
-5
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/beta/entropy/benchmark/c

1 file changed

+7
-5
lines changed

lib/node_modules/@stdlib/stats/base/dists/beta/entropy/benchmark/c/benchmark.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ static double tic( void ) {
7676
}
7777

7878
/**
79-
* Generates a random number on the interval [0,1).
79+
* Generates a random number on the interval [min,max).
8080
*
81-
* @return random number
81+
* @param min minimum value (inclusive)
82+
* @param max maximum value (exclusive)
83+
* @return random number
8284
*/
83-
static double rand_double( void ) {
84-
int r = rand();
85-
return (double)r / ( (double)RAND_MAX + 1.0 );
85+
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) );
8688
}
8789

8890
/**

0 commit comments

Comments
 (0)