Skip to content

Commit 29adabd

Browse files
authored
Update index.js
Signed-off-by: Harsh <[email protected]>
1 parent a56c822 commit 29adabd

File tree

1 file changed

+9
-9
lines changed
  • lib/node_modules/@stdlib/stats/incr/nanrss/examples

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ accumulator = incrnanrss();
3333
// For each simulated datum, update the residual sum of squares...
3434
console.log( '\nValue\tValue\tRSS\n' );
3535
for ( i = 0; i < 100; i++ ) {
36-
if ( randu() < 0.2 ) {
37-
v1 = NaN;
38-
v2 = NaN;
39-
} else {
40-
v1 = ( randu()*100.0 ) - 50.0;
41-
v2 = ( randu()*100.0 ) - 50.0;
42-
}
43-
rss = accumulator( v1, v2 );
44-
console.log( '%d\t%d\t%d', v1.toFixed( 3 ), v2.toFixed( 3 ), ( rss === null ) ? NaN : rss.toFixed( 3 ) );
36+
if ( randu() < 0.2 ) {
37+
v1 = NaN;
38+
v2 = NaN;
39+
} else {
40+
v1 = ( randu()*100.0 ) - 50.0;
41+
v2 = ( randu()*100.0 ) - 50.0;
42+
}
43+
rss = accumulator( v1, v2 );
44+
console.log( '%d\t%d\t%d', v1.toFixed( 3 ), v2.toFixed( 3 ), ( rss === null ) ? NaN : rss.toFixed( 3 ) );
4545
}
4646
console.log( '\nFinal RSS: %d\n', accumulator() );

0 commit comments

Comments
 (0)