Skip to content

Commit 9b943cf

Browse files
committed
updated benchmark.js and readme.md
1 parent 9ce0db3 commit 9b943cf

File tree

3 files changed

+6
-27
lines changed

3 files changed

+6
-27
lines changed

lib/node_modules/@stdlib/stats/incr/nanmsumabs2/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ sum = accumulator( 2.0 ); // [2.0]
7676
sum = accumulator( -1.0 ); // [2.0, -1.0]
7777
// returns 5.0
7878

79-
sum = accumulator( NaN ); // [2.0, -1.0, NaN]
79+
sum = accumulator( NaN ); // [2.0, -1.0]
8080
// returns 5.0
8181

8282
sum = accumulator( 3.0 ); // [2.0, -1.0, 3.0]
@@ -86,7 +86,7 @@ sum = accumulator( 3.0 ); // [2.0, -1.0, 3.0]
8686
sum = accumulator( -7.0 ); // [-1.0, 3.0, -7.0]
8787
// returns 59.0
8888

89-
sum = accumulator( NaN ); // [3.0, -7.0, NaN]
89+
sum = accumulator( NaN ); // [3.0, -7.0]
9090
// returns 59.0
9191

9292
sum = accumulator();

lib/node_modules/@stdlib/stats/incr/nanmsumabs2/benchmark/benchmark.js

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,14 @@ bench( pkg, function benchmark( b ) {
4545
b.pass( 'benchmark finished' );
4646
b.end();
4747
});
48+
4849
bench( pkg+'::accumulator', function benchmark( b ) {
4950
var acc;
5051
var v;
5152
var i;
53+
5254
acc = incrnanmsumabs2( 5 );
55+
5356
b.tic();
5457
for ( i = 0; i < b.iterations; i++ ) {
5558
v = acc( randu()-0.5 );
@@ -64,26 +67,3 @@ bench( pkg+'::accumulator', function benchmark( b ) {
6467
b.pass( 'benchmark finished' );
6568
b.end();
6669
});
67-
bench( pkg+'::accumulator,includes_nan', function benchmark( b ) {
68-
var acc;
69-
var v;
70-
var i;
71-
acc = incrnanmsumabs2( 5 );
72-
b.tic();
73-
for ( i = 0; i < b.iterations; i++ ) {
74-
if ( i % 10 === 0 ) {
75-
v = acc( NaN );
76-
} else {
77-
v = acc( randu()-0.5 );
78-
}
79-
if ( v !== v && i % 10 !== 0 ) {
80-
b.fail( 'should not return NaN' );
81-
}
82-
}
83-
b.toc();
84-
if ( v !== v && b.iterations % 10 !== 0 ) {
85-
b.fail( 'should not return NaN' );
86-
}
87-
b.pass( 'benchmark finished' );
88-
b.end();
89-
});

lib/node_modules/@stdlib/stats/incr/nanmsumabs2/docs/repl.text

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,4 @@
4444

4545
See Also
4646
--------
47-
@stdlib/stats/incr/msumabs2: compute a moving sum of squared absolute values incrementally.
48-
@stdlib/stats/incr/nansum: compute a sum incrementally, ignoring NaN values.
47+

0 commit comments

Comments
 (0)