Skip to content

Commit 8d8ee51

Browse files
committed
bench: fix failing C benchmarks by using round
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent dd7b58d commit 8d8ee51

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)