Skip to content

Commit 37d2210

Browse files
committed
made suggested change
1 parent f71eed2 commit 37d2210

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,12 @@ var incrnanminmax = require( '@stdlib/stats/incr/nanminmax' );
3232

3333
#### incrnanminmax( \[out] )
3434

35-
Returns an accumulator `function` which incrementally computes a minimum and maximum, ignoring `NaN` values.
35+
Returns an accumulator function which incrementally computes a minimum and maximum, ignoring `NaN` values.
3636

3737
```javascript
3838
var accumulator = incrnanminmax();
3939
```
4040

41-
By default, the returned accumulator `function` returns the minimum and maximum as a two-element `array`. To avoid unnecessary memory allocation, the function supports providing an output (destination) object.
42-
43-
4441
#### accumulator( \[x] )
4542

4643
If provided an input value `x`, the accumulator function returns updated minimum and maximum values. If not provided an input value `x`, the accumulator function returns the current minimum and maximum values.
@@ -112,7 +109,7 @@ for ( i = 0; i < 100; i++ ) {
112109
v = randu() * 100.0;
113110
}
114111
}
115-
console.log( accumulator() );
112+
console.log( accumulator( v ) );
116113
```
117114

118115
</section>

lib/node_modules/@stdlib/stats/incr/nanminmax/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
{{alias}}( [out] )
33
Returns an accumulator function which incrementally computes a minimum and
4-
maximum, ignoring `NaN` values.
4+
maximum,, ignoring `NaN` values.
55

66
If provided a value, the accumulator function returns an updated minimum and
77
maximum. If not provided a value, the accumulator function returns the

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ var incrminmax = require( '@stdlib/stats/incr/minmax' );
5757
* // returns [ -5.0, 5.0 ]
5858
*/
5959
function incrnanminmax( out ) {
60-
var nanminmax;
60+
var minmax;
6161
if ( arguments.length === 0 ) {
62-
nanminmax = incrminmax();
63-
}
64-
else {
65-
nanminmax = incrminmax( out );
62+
minmax = incrminmax();
63+
} else {
64+
minmax = incrminmax( out );
6665
}
6766
return accumulator;
6867

@@ -75,9 +74,9 @@ function incrnanminmax( out ) {
7574
*/
7675
function accumulator( x ) {
7776
if ( arguments.length === 0 || isnan( x ) ) {
78-
return nanminmax();
77+
return minmax();
7978
}
80-
return nanminmax( x );
79+
return minmax( x );
8180
}
8281
}
8382

0 commit comments

Comments
 (0)