Skip to content

Commit 8eba849

Browse files
committed
chore: clean-up
--- 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: passed - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent cd6bcf9 commit 8eba849

3 files changed

Lines changed: 19 additions & 24 deletions

File tree

lib/node_modules/@stdlib/number/float16/base/mul/README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,14 @@ v = mul( NaN, NaN );
8282
<!-- eslint no-undef: "error" -->
8383

8484
```javascript
85-
var rand = require( '@stdlib/random/base/discrete-uniform' );
85+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
86+
var logEachMap = require( '@stdlib/console/log-each-map' );
8687
var mul = require( '@stdlib/number/float16/base/mul' );
8788

88-
var x;
89-
var y;
90-
var i;
89+
var x = discreteUniform( 100, -50, 50 );
90+
var y = discreteUniform( 100, -50, 50 );
9191

92-
for ( i = 0; i < 100; i++ ) {
93-
x = rand( -50, 50 );
94-
y = rand( -50, 50 );
95-
console.log( '%d x %d = %d', x, y, mul( x, y ) );
96-
}
92+
logEachMap( '%d x %d = %d', x, y, mul );
9793
```
9894

9995
</section>

lib/node_modules/@stdlib/number/float16/base/mul/benchmark/benchmark.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
24+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
26+
var format = require( '@stdlib/string/format' );
2627
var pkg = require( './../package.json' ).name;
2728
var mul = require( './../lib' );
2829

@@ -34,10 +35,11 @@ bench( pkg, function benchmark( b ) {
3435
var y;
3536
var i;
3637

38+
x = discreteUniform( 100, -100, 100 );
39+
3740
b.tic();
3841
for ( i = 0; i < b.iterations; i++ ) {
39-
x = ( randu()*1000.0 ) - 500.0;
40-
y = mul( x, 5.0 );
42+
y = mul( x[ i%x.length ], 5.0 );
4143
if ( isnan( y ) ) {
4244
b.fail( 'should not return NaN' );
4345
}
@@ -50,15 +52,16 @@ bench( pkg, function benchmark( b ) {
5052
b.end();
5153
});
5254

53-
bench( pkg+'::inline', function benchmark( b ) {
55+
bench( format( '%s::inline', pkg ), function benchmark( b ) {
5456
var x;
5557
var y;
5658
var i;
5759

60+
x = discreteUniform( 100, -100, 100 );
61+
5862
b.tic();
5963
for ( i = 0; i < b.iterations; i++ ) {
60-
x = ( randu()*1000.0 ) - 500.0;
61-
y = x * 5.0;
64+
y = x[ i%x.length ] * 5.0;
6265
if ( isnan( y ) ) {
6366
b.fail( 'should not return NaN' );
6467
}

lib/node_modules/@stdlib/number/float16/base/mul/examples/index.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@
1818

1919
'use strict';
2020

21-
var rand = require( '@stdlib/random/base/discrete-uniform' );
21+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
22+
var logEachMap = require( '@stdlib/console/log-each-map' );
2223
var mul = require( './../lib' );
2324

24-
var x;
25-
var y;
26-
var i;
25+
var x = discreteUniform( 100, -50, 50 );
26+
var y = discreteUniform( 100, -50, 50 );
2727

28-
for ( i = 0; i < 100; i++ ) {
29-
x = rand( -50, 50 );
30-
y = rand( -50, 50 );
31-
console.log( '%d x %d = %d', x, y, mul( x, y ) );
32-
}
28+
logEachMap( '%d x %d = %d', x, y, mul );

0 commit comments

Comments
 (0)