Skip to content

Commit 7ab9228

Browse files
authored
Apply suggestions from code review
Signed-off-by: Athan <[email protected]>
1 parent afa597b commit 7ab9228

File tree

1 file changed

+5
-5
lines changed
  • lib/node_modules/@stdlib/stats/base/nanvarianceyc

1 file changed

+5
-5
lines changed

lib/node_modules/@stdlib/stats/base/nanvarianceyc/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ The function has the following parameters:
119119
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`,
120120

121121
```javascript
122-
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ];
122+
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ];
123123

124-
var v = nanvarianceyc( 4, 1, x, 2 );
124+
var v = nanvarianceyc( 5, 1, x, 2 );
125125
// returns 6.25
126126
```
127127

@@ -132,10 +132,10 @@ Note that indexing is relative to the first index. To introduce an offset, use [
132132
```javascript
133133
var Float64Array = require( '@stdlib/array/float64' );
134134

135-
var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
135+
var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );
136136
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
137137

138-
var v = nanvarianceyc( 4, 1, x1, 2 );
138+
var v = nanvarianceyc( 5, 1, x1, 2 );
139139
// returns 6.25
140140
```
141141

@@ -154,7 +154,7 @@ The function has the following additional parameters:
154154

155155
- **offsetX**: starting index for `x`.
156156

157-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value
157+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the [variance][variance] for every other value in `x` starting from the second value
158158

159159
```javascript
160160
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];

0 commit comments

Comments
 (0)