Skip to content

Commit 6737ce1

Browse files
committed
updated the main.js
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 9cdec3c commit 6737ce1

File tree

1 file changed

+3
-1
lines changed
  • lib/node_modules/@stdlib/stats/incr/nanrange/libs

1 file changed

+3
-1
lines changed

lib/node_modules/@stdlib/stats/incr/nanrange/libs/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ function incrnanrange() {
5757
var range;
5858
var max = NINF;
5959
var min = PINF;
60+
var hasValidValue = false;
6061

6162
return accumulator;
6263

@@ -69,7 +70,7 @@ function incrnanrange() {
6970
*/
7071
function accumulator( x ) {
7172
if ( arguments.length === 0 ) {
72-
return ( range === void 0 ) ? null : range;
73+
return hasValidValue ? range : null;
7374
}
7475
if ( isnan( x ) ) {
7576
return range;
@@ -80,6 +81,7 @@ function incrnanrange() {
8081
if ( x < min ) {
8182
min = x;
8283
}
84+
hasValidValue = true;
8385
range = max - min;
8486
return range;
8587
}

0 commit comments

Comments
 (0)