RosettaCodeData/Task/Averages-Arithmetic-mean/Processing/averages-arithmetic-mean.processing

8 lines
114 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
float mean(float[] arr) {
float out = 0;
for (float n : arr) {
out += n;
}
return out / arr.length;
}