array-normalize
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -34,3 +34,3 @@ 'use strict' | ||
for (i = offset; i < l; i+=dim) { | ||
arr[i] = (arr[i] - min) / range | ||
arr[i] = range === 0 ? .5 : (arr[i] - min) / range | ||
} | ||
@@ -37,0 +37,0 @@ } |
{ | ||
"name": "array-normalize", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Normalize array (possibly n-dimensional) to zero mean and unit variance", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,1 +21,4 @@ 'use strict' | ||
assert.deepEqual(norm(e.slice(), 2, getBounds(e, 2)), [0, 0, .1, .1, 1, 1]) | ||
let f = [0, .25, 1, .25] | ||
assert.deepEqual(norm(f, 2, [0, .5, 1, .5]), [0, .5, 1, .5]) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4813
93