Averages/Arithmetic mean: Difference between revisions

no edit summary
No edit summary
Line 432:
mean xs = let (s,l) = foldl' f (0, 0) xs in realToFrac s / l
where f (!s,!l) x = (s+x,l+1)</lang>
 
=={{header|HicEst}}==
<lang hicest>REAL :: vec(100) ! no zero-length arrays in HicEst
 
vec = $ - 1/2 ! 0.5 ... 99.5
mean = SUM(vec) / LEN(vec) ! 50
END </lang>
 
=={{header|IDL}}==
Anonymous user