tahamajs's picture
download
raw
561 Bytes
import "../math/number";
d3.variance = function(array, f) {
var n = array.length,
m = 0,
a,
d,
s = 0,
i = -1,
j = 0;
if (arguments.length === 1) {
while (++i < n) {
if (d3_numeric(a = d3_number(array[i]))) {
d = a - m;
m += d / ++j;
s += d * (a - m);
}
}
} else {
while (++i < n) {
if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) {
d = a - m;
m += d / ++j;
s += d * (a - m);
}
}
}
if (j > 1) return s / (j - 1);
};

Xet Storage Details

Size:
561 Bytes
·
Xet hash:
c2c31e77de9873171f4ca4f68748ac3d42bb0a9358dc07ad7f7e81ccffdb42da

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.