Skip to content

Commit 81cd50a

Browse files
committed
fix: update variable name for clarity and improve example usage in nanmeanors
--- 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 228ebd1 commit 81cd50a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
* // returns 1.25
4242
*/
4343
function nanmeanors( N, x, strideX, offsetX ) {
44-
var xget;
4544
var xbuf;
45+
var get;
4646
var sum;
4747
var ix;
4848
var v;
@@ -53,16 +53,16 @@ function nanmeanors( N, x, strideX, offsetX ) {
5353
xbuf = x.data;
5454

5555
// Cache references to element accessors:
56-
xget = x.accessors[ 0 ];
56+
get = x.accessors[ 0 ];
5757

5858
if ( N === 1 || strideX === 0 ) {
59-
return xget( xbuf, offsetX );
59+
return get( xbuf, offsetX );
6060
}
6161
ix = offsetX;
6262
sum = 0.0;
6363
n = 0;
6464
for ( i = 0; i < N; i++ ) {
65-
v = xget( xbuf, ix );
65+
v = get( xbuf, ix );
6666
if ( v === v ) {
6767
sum += v;
6868
n += 1;

lib/node_modules/@stdlib/stats/base/nanmeanors/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 = nanmeanors( 4, x, 1 );
31+
* var v = nanmeanors( x.length, x, 1 );
3232
* // returns ~0.3333
3333
*
3434
* @example

0 commit comments

Comments
 (0)