Comparing version 1.0.0 to 1.0.1
27
array.js
@@ -5,5 +5,5 @@ 'use strict'; | ||
function max(values) { | ||
var max = -Infinity, l=values.length; | ||
for(var i=0; i<l; i++) { | ||
if(values[i] > max) max = values[i]; | ||
var max = -Infinity, l = values.length; | ||
for (var i = 0; i < l; i++) { | ||
if (values[i] > max) max = values[i]; | ||
} | ||
@@ -14,5 +14,5 @@ return max; | ||
function min(values) { | ||
var min = Infinity, l=values.length; | ||
for(var i=0; i<l; i++) { | ||
if(values[i] < min) min = values[i]; | ||
var min = Infinity, l = values.length; | ||
for (var i = 0; i < l; i++) { | ||
if (values[i] < min) min = values[i]; | ||
} | ||
@@ -22,2 +22,16 @@ return min; | ||
function minMax(values) { | ||
var min = Infinity, | ||
max = -Infinity, | ||
l = values.length; | ||
for (var i = 0; i < l; i++) { | ||
if (values[i] < min) min = values[i]; | ||
if (values[i] > max) max = values[i]; | ||
} | ||
return { | ||
min: min, | ||
max: max | ||
}; | ||
} | ||
function mean(values) { | ||
@@ -327,2 +341,3 @@ var sum = 0, l = values.length; | ||
max: max, | ||
minMax: minMax, | ||
mean: mean, | ||
@@ -329,0 +344,0 @@ geometricMean: geometricMean, |
@@ -1,4 +0,9 @@ | ||
1.0.0 / TBD | ||
1.0.1 / 2015-02-02 | ||
================== | ||
* add array.minMax | ||
1.0.0 / 2015-01-27 | ||
================== | ||
* first release |
{ | ||
"name": "ml-stat", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Functions for computing stats on arrays and matrices", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,2 +24,3 @@ # ml-stat | ||
- [Michaël Zasso](https://github.com/targos) | ||
- [Daniel Kostro](https://github.com/stropitek) | ||
@@ -26,0 +27,0 @@ ## License |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
25935
788
34
1