Skip to content

Commit 5e5440d

Browse files
Update benchmark.c
Replaced rand_int from rand_double as mentioned across other files Signed-off-by: Harsh Mathur <[email protected]>
1 parent 7a88267 commit 5e5440d

File tree

1 file changed

+3
-2
lines changed
  • lib/node_modules/@stdlib/math/base/special/lcmf/benchmark/c

1 file changed

+3
-2
lines changed

lib/node_modules/@stdlib/math/base/special/lcmf/benchmark/c/benchmark.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ static double tic( void ) {
7979
*
8080
* @return random integer
8181
*/
82-
static int rand_int( void ) {
83-
return (rand() % 20) + 1; // Random value between 1 and 20 for small lcmf tests
82+
static double rand_double( void ) {
83+
int r = rand();
84+
return (double)r / ( (double)RAND_MAX + 1.0 );
8485
}
8586

8687
/**

0 commit comments

Comments
 (0)