Skip to content

Commit bc77c43

Browse files
committed
bench: update c benchmarks
--- 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: missing_dependencies - 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 3c993ca commit bc77c43

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/node_modules/@stdlib/stats/base/sdsnanmean/benchmark/c/benchmark.length.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ static double benchmark1( int iterations, int len ) {
102102
int i;
103103

104104
for ( i = 0; i < len; i++ ) {
105-
if ( rand_double() < 0.2 ) {
106-
x[ i ] = 0.0 / 0.0; // NaN
105+
if ( rand_float() < 0.2 ) {
106+
x[ i ] = 0.0f / 0.0f; // NaN
107107
} else {
108-
x[ i ] = ( rand_double() * 20000.0 ) - 10000.0;
108+
x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f;
109109
}
110110
}
111111
v = 0.0f;
@@ -140,10 +140,10 @@ static double benchmark2( int iterations, int len ) {
140140
int i;
141141

142142
for ( i = 0; i < len; i++ ) {
143-
if ( rand_double() < 0.2 ) {
144-
x[ i ] = 0.0 / 0.0; // NaN
143+
if ( rand_float() < 0.2 ) {
144+
x[ i ] = 0.0f / 0.0f; // NaN
145145
} else {
146-
x[ i ] = ( rand_double() * 20000.0 ) - 10000.0;
146+
x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f;
147147
}
148148
}
149149
v = 0.0f;

0 commit comments

Comments
 (0)