Anonymous user
Averages/Arithmetic mean: Difference between revisions
Logo
(Logo) |
|||
Line 201:
return a.length ? Functional.reduce('+', 0, a) / a.length : 0;
}
=={{header|Logo}}==
to average :l
if empty? :l [output 0]
output quotient apply "sum :l count :l
end
print average [1 2 3 4] ; 2.5
=={{header|MAXScript}}==
|