Skip to content

Commit f6ccb9b

Browse files
committed
check
1 parent a07ba7f commit f6ccb9b

File tree

6 files changed

+33
-12
lines changed

6 files changed

+33
-12
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ accumulator = incrnanskewness();
151151
// For each simulated datum, update the corrected sample skewness...
152152
for ( i = 0; i < 100; i++ ) {
153153
if ( randu() < 0.2 ) {
154-
v = NaN;
155-
} else {
156-
v = randu() * 100.0;
157-
}
154+
v = NaN;
155+
} else {
156+
v = randu() * 100.0;
157+
}
158158
accumulator( v );
159159
}
160160
console.log( accumulator() );

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ for ( i = 0; i < 100; i++ ) {
3939
v = randu() * 100.0;
4040
}
4141
skewness = accumulator( v );
42-
if ( i < 2 ) {
42+
if ( i < 2 || skewness === null ) {
4343
console.log( '%d\t%s', v.toFixed( 4 ), skewness );
4444
} else {
4545
console.log( '%d\t%d', v.toFixed( 4 ), skewness.toFixed( 4 ) );

lib/node_modules/@stdlib/stats/incr/nanskewness/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Compute a corrected sample skewness incrementally, ignoring `NaN` values.
2323
*
24-
* @module @stdlib/stats/incr/skewness
24+
* @module @stdlib/stats/incr/nanskewness
2525
*
2626
* @example
2727
* var incrnanskewness = require( '@stdlib/stats/incr/nanskewness' );

lib/node_modules/@stdlib/stats/incr/nanskewness/lib/main.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
119
'use strict';
220

321
// MODULES //
22+
423
var isnan = require( '@stdlib/math/base/assert/is-nan' );
524
var incrskewness = require( '@stdlib/stats/incr/skewness' );
625

26+
727
// MAIN //
828
/**
929
* Returns an accumulator function which incrementally computes a corrected sample skewness, **ignoring NaN values**.
@@ -52,5 +72,7 @@ function incrnanskewness() {
5272
};
5373
}
5474

75+
5576
// EXPORTS //
77+
5678
module.exports = incrnanskewness;

lib/node_modules/@stdlib/stats/incr/nanskewness/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,3 @@
6363
"accumulator"
6464
]
6565
}
66-

lib/node_modules/@stdlib/stats/incr/nanskewness/test/test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2018 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -55,10 +55,10 @@ tape( 'the accumulator function incrementally computes a corrected sample skewne
5555
expected = [
5656
null,
5757
null,
58-
null,
58+
null,
5959
1.457862967321305,
6060
0.4366620845757488,
61-
0.4366620845757488,
61+
0.4366620845757488,
6262
0.1171875
6363
];
6464

@@ -108,13 +108,13 @@ tape( 'the corrected sample skewness is `null` until at least 3 datums have been
108108
t.equal( skewness, null, 'returns null' );
109109

110110
skewness = acc( NaN );
111-
t.equal( skewness, null, 'returns null' );
111+
t.equal( skewness, null, 'returns null' );
112112

113113
skewness = acc( 2.0 );
114114
t.equal( skewness, null, 'returns null' );
115115

116116
skewness = acc( NaN );
117-
t.equal( skewness, null, 'returns null' );
117+
t.equal( skewness, null, 'returns null' );
118118

119119
skewness = acc( 3.0 );
120120
t.equal( skewness, null, 'returns null' );

0 commit comments

Comments
 (0)