mean function

double mean(
  1. Array a
)

Return the mean of all elements of the array

Examples

var n = Array([1, 2, 3]);

print(mean(n));

/* output:
2.0
*/

Implementation

double mean(Array a) {
  return arraySum(a) / a.length;
}