Averages/Root mean square: Difference between revisions
m
→AppleScript :: Functional: Tidied
(→{{header|AppleScript}}: Added straightforward solution and loopless integer range alternative.) |
m (→AppleScript :: Functional: Tidied) |
||
Line 228:
===Functional===
{{Trans|JavaScript}}( ES6 version )
<syntaxhighlight lang="applescript">---------------------
-- rootMeanSquare :: [Num] -> Real
on rootMeanSquare(xs)
script
Line 240 ⟶ 242:
on run
Line 249 ⟶ 251:
-- foldl :: (a -> b -> a) -> a -> [b] -> a
Line 277 ⟶ 279:
<pre>6.204836822995</pre>
----
===Straightforward===
<syntaxhighlight lang="applescript">on rootMeanSquare(listOfNumbers)
|