MCPcopy Create free account
hub / github.com/arguiot/TheoremJS / average

Method average

__test__/theorem.js:198–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196 return [...arguments].reduce((a, b) => new BigNumber(a).plus(b))
197 }
198 average() {
199 const summed = this.sum(...arguments);
200 const average = new BigNumber(summed).div(arguments.length);
201 return average
202 }
203 correlation(array1, array2) {
204 if (array1.length != array2.length) {
205 throw "[TheoremJS]: Correlation error, arrays are not the same size"

Callers 3

correlationMethod · 0.95
correlation.jsFile · 0.80
test.jsFile · 0.80

Calls 2

sumMethod · 0.95
divMethod · 0.80

Tested by

no test coverage detected