Skip to content

Commit 81f904d

Browse files
authored
bench: fix failing C benchmarks by using round and roundf
PR-URL: #7980 Reviewed-by: Athan Reines <[email protected]>
1 parent dd7b58d commit 81f904d

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

lib/node_modules/@stdlib/math/base/special/bernoulli/benchmark/c/native/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static double benchmark( void ) {
9797
int i;
9898

9999
for ( i = 0; i < 100; i++ ) {
100-
x[ i ] = ( 500.0 * rand_double() );
100+
x[ i ] = round( 500.0 * rand_double() );
101101
}
102102

103103
t = tic();

lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static double benchmark( void ) {
9797
int i;
9898

9999
for ( i = 0; i < 100; i++ ) {
100-
x[ i ] = ( 500.0f * rand_float() );
100+
x[ i ] = roundf( 500.0f * rand_float() );
101101
}
102102

103103
t = tic();

lib/node_modules/@stdlib/math/base/special/lucas/benchmark/c/native/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static double benchmark( void ) {
9898

9999
t = tic();
100100
for ( i = 0; i < ITERATIONS; i++ ) {
101-
x = ( 76.0*rand_double() );
101+
x = round( 76.0*rand_double() );
102102
y = stdlib_base_lucas( x );
103103
if ( y != y ) {
104104
printf( "should not return NaN\n" );

lib/node_modules/@stdlib/math/base/special/lucasf/benchmark/c/native/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static double benchmark( void ) {
9898
int i;
9999

100100
for ( i = 0; i < 100; i++ ) {
101-
x[ i ] = ( 34.0f*rand_float() );
101+
x[ i ] = roundf( 34.0f*rand_float() );
102102
}
103103

104104
t = tic();

lib/node_modules/@stdlib/math/base/special/negalucas/benchmark/c/native/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static double benchmark( void ) {
9797
int i;
9898

9999
for ( i = 0; i < 100; i++ ) {
100-
x[ i ] = ( 77.0*rand_double() );
100+
x[ i ] = round( 77.0*rand_double() );
101101
}
102102

103103
t = tic();

lib/node_modules/@stdlib/math/base/special/negalucasf/benchmark/c/native/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static double benchmark( void ) {
9797
int i;
9898

9999
for ( i = 0; i < 100; i++ ) {
100-
x[ i ] = ( 34.0f * rand_float() );
100+
x[ i ] = roundf( 34.0f * rand_float() );
101101
}
102102

103103
t = tic();

0 commit comments

Comments
 (0)