-
Notifications
You must be signed in to change notification settings - Fork 0
geometricMean
Subhajit Sahu edited this page Aug 9, 2022
·
2 revisions
Find the geometric mean of numbers.
Similar: arithmethicMean, geometricMean, harmonicMean, quadriaticMean, cubicMean.
function geometricMean(...xs)
// xs: a list of numbers
const xnumber = require('extra-number');
xnumber.geometricMean(1, 2);
// → 1.4142135623730951 (Math.sqrt(2))
xnumber.geometricMean(1, 2, 3);
// → 1.8171205928321397 (Math.cbrt(6))
xnumber.geometricMean(1, 2, 3, 4);
// → 2.2133638394006434 (Math.pow(24, 1/4))