Skip to content

Commit d91b610

Browse files
committed
solving eslint issue
1 parent 126399d commit d91b610

File tree

1 file changed

+10
-4
lines changed
  • lib/node_modules/@stdlib/stats/incr/nanmsumabs2/examples

1 file changed

+10
-4
lines changed

lib/node_modules/@stdlib/stats/incr/nanmsumabs2/examples/index.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,26 @@
2020

2121
var randu = require( '@stdlib/random/base/randu' );
2222
var incrnanmsumabs2 = require( './../lib' );
23+
2324
var accumulator;
2425
var sum;
2526
var v;
2627
var i;
28+
2729
// Initialize an accumulator:
2830
accumulator = incrnanmsumabs2( 5 );
31+
2932
// For each simulated datum, update the moving sum...
33+
3034
console.log( '\nValue\tSum\n' );
35+
3136
for ( i = 0; i < 100; i++ ) {
32-
if ( randu() < 0.2 ) {
33-
v = NaN;
37+
if ( randu() >= 0.2 ) {
38+
v = ( randu() * 100.0 ) - 50.0;
3439
} else {
35-
v = ( randu()*100.0 ) - 50.0;
40+
v = NaN;
3641
}
42+
3743
sum = accumulator( v );
38-
console.log( '%s\t%s', v.toString(), sum !== null ? sum.toFixed(3) : 'null' );
44+
console.log( '%s\t%s', v.toString(), (sum !== null) ? sum.toFixed(3) : 'null' );
3945
}

0 commit comments

Comments
 (0)