Skip to content

Commit 40d18bb

Browse files
committed
fix: update nanvariancech example
--- 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: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent b2c551e commit 40d18bb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/node_modules/@stdlib/stats/base/nanvariancech/lib/accessors.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
* // returns 6.25
5454
*/
5555
function nanvariancech( N, correction, x, strideX, offsetX ) {
56-
var xget;
5756
var xbuf;
57+
var get;
5858
var mu;
5959
var ix;
6060
var M2;
@@ -69,10 +69,10 @@ function nanvariancech( N, correction, x, strideX, offsetX ) {
6969
xbuf = x.data;
7070

7171
// Cache references to element accessors:
72-
xget = x.accessors[ 0 ];
72+
get = x.accessors[ 0 ];
7373

7474
if ( N === 1 || strideX === 0 ) {
75-
v = xget( xbuf, offsetX );
75+
v = get( xbuf, offsetX );
7676
if ( v === v && N-correction > 0.0 ) {
7777
return 0.0;
7878
}
@@ -82,7 +82,7 @@ function nanvariancech( N, correction, x, strideX, offsetX ) {
8282

8383
// Find an estimate for the mean...
8484
for ( i = 0; i < N; i++ ) {
85-
v = xget( xbuf, ix );
85+
v = get( xbuf, ix );
8686
if ( v === v ) {
8787
mu = v;
8888
break;
@@ -100,7 +100,7 @@ function nanvariancech( N, correction, x, strideX, offsetX ) {
100100
M = 0.0;
101101
n = 1;
102102
for ( i; i < N; i++ ) {
103-
v = xget( xbuf, ix );
103+
v = get( xbuf, ix );
104104
if ( v === v ) {
105105
d = v - mu;
106106
M2 += d * d;

lib/node_modules/@stdlib/stats/base/nanvariancech/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* var x = [ 1.0, -2.0, NaN, 2.0 ];
3030
*
31-
* var v = nanvariancech( 4, 1, x, 1 );
31+
* var v = nanvariancech( x.length, 1, x, 1 );
3232
* // returns ~4.3333
3333
*
3434
* @example

lib/node_modules/@stdlib/stats/base/nanvariancech/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var ndarray = require( './ndarray.js' );
4949
* @example
5050
* var x = [ 1.0, -2.0, NaN, 2.0 ];
5151
*
52-
* var v = nanvariancech( 4, 1, x, 1 );
52+
* var v = nanvariancech( x.length, 1, x, 1 );
5353
* // returns ~4.3333
5454
*/
5555
function nanvariancech( N, correction, x, strideX ) {

0 commit comments

Comments
 (0)