Skip to content

Commit fe4b9d6

Browse files
committed
bench: refactor to use logEachMap in examples
--- 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: passed - 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: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 6ef94e1 commit fe4b9d6

1 file changed

Lines changed: 10 additions & 14 deletions

File tree

  • lib/node_modules/@stdlib/stats/base/dists/frechet/kurtosis

lib/node_modules/@stdlib/stats/base/dists/frechet/kurtosis/README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,23 +133,19 @@ y = kurtosis( 1.0, -1.0, 2.0 );
133133
<!-- eslint no-undef: "error" -->
134134

135135
```javascript
136-
var randu = require( '@stdlib/random/base/randu' );
136+
var uniform = require( '@stdlib/random/array/uniform' );
137+
var logEachMap = require( '@stdlib/console/log-each-map' );
137138
var EPS = require( '@stdlib/constants/float64/eps' );
138139
var kurtosis = require( '@stdlib/stats/base/dists/frechet/kurtosis' );
139140

140-
var alpha;
141-
var m;
142-
var s;
143-
var y;
144-
var i;
145-
146-
for ( i = 0; i < 10; i++ ) {
147-
alpha = ( randu()*20.0 ) + EPS;
148-
s = ( randu()*20.0 ) + EPS;
149-
m = ( randu()*40.0 ) - 20.0;
150-
y = kurtosis( alpha, s, m );
151-
console.log( 'α: %d, s: %d, m: %d, Kurt(X;α,s,m): %d', alpha.toFixed( 4 ), s.toFixed( 4 ), m.toFixed( 4 ), y.toFixed( 4 ) );
152-
}
141+
var opts = {
142+
'dtype': 'float64'
143+
};
144+
var alpha = uniform( 10, EPS, 20.0, opts );
145+
var s = uniform( 10, EPS, 20.0, opts );
146+
var m = uniform( 10, -20.0, 20.0, opts );
147+
148+
logEachMap( 'α: %0.4f, s: %0.4f, m: %0.4f, Kurtosis(X;α,s,m): %0.4f', alpha, s, m, kurtosis );
153149
```
154150

155151
</section>

0 commit comments

Comments
 (0)