mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Use lodash.reduce in getGeometricMean of perf.js. [ci skip]
Former-commit-id: 7c5af9afcd56958e03f96d3f13f396894cf95f4b
This commit is contained in:
@@ -114,7 +114,7 @@
|
||||
* @returns {Number} The geometric mean.
|
||||
*/
|
||||
function getGeometricMean(array) {
|
||||
return Math.pow(Math.E, _.reduce(array, function(sum, x) {
|
||||
return Math.pow(Math.E, lodash.reduce(array, function(sum, x) {
|
||||
return sum + Math.log(x);
|
||||
}, 0) / array.length) || 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user