Skip to content

Commit ae5f230

Browse files
committed
bench: fix value generation
--- 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: passed - 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: na - 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 ab27369 commit ae5f230

File tree

1 file changed

+6
-2
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/rayleigh/quantile/benchmark

1 file changed

+6
-2
lines changed

lib/node_modules/@stdlib/stats/base/dists/rayleigh/quantile/benchmark/benchmark.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,14 @@ bench( pkg+':factory', function benchmark( b ) {
7171
sigma = 4.0;
7272
myquantile = quantile.factory( sigma );
7373

74+
p = new Float64Array( 100 );
75+
for ( i = 0; i < 100; i++ ) {
76+
p[ i ] = uniform( 0.0, 1.0 );
77+
}
78+
7479
b.tic();
7580
for ( i = 0; i < b.iterations; i++ ) {
76-
p = randu();
77-
y = myquantile( p );
81+
y = myquantile( p[ i%p.length ] );
7882
if ( isnan( y ) ) {
7983
b.fail( 'should not return NaN' );
8084
}

0 commit comments

Comments
 (0)