Skip to content

Commit a9b8497

Browse files
chore: update bench
1 parent d3ca5b5 commit a9b8497

File tree

1 file changed

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

1 file changed

+7
-5
lines changed

lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/benchmark/c/benchmark.c

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

7979
/**
80-
* Generates a random number on the interval [0,1).
80+
* Generates a random number on the interval [min,max).
8181
*
82-
* @return random number
82+
* @param min minimum value (inclusive)
83+
* @param max maximum value (exclusive)
84+
* @return random number
8385
*/
84-
static double rand_double( void ) {
85-
int r = rand();
86-
return (double)r / ( (double)RAND_MAX + 1.0 );
86+
static double random_uniform( const double min, const double max ) {
87+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
88+
return min + ( v*(max-min) );
8789
}
8890

8991
/**

0 commit comments

Comments
 (0)