Averages/Root mean square: Difference between revisions

Content deleted Content added
Hout (talk | contribs)
Hout (talk | contribs)
m →‎{{header|AppleScript}}: rationalised a name
Line 122: Line 122:
<lang AppleScript>-- rootMeanSquare :: [Num] -> Real
<lang AppleScript>-- rootMeanSquare :: [Num] -> Real
on rootMeanSquare(xs)
on rootMeanSquare(xs)
script plusProduct
script plusSquare
on lambda(a, x)
on lambda(a, x)
a + x * x
a + x * x
Line 128: Line 128:
end script
end script
(foldl(plusProduct, 0, xs) / (length of xs)) ^ (1 / 2)
(foldl(plusSquare, 0, xs) / (length of xs)) ^ (1 / 2)
end rootMeanSquare
end rootMeanSquare