Averages/Root mean square: Difference between revisions

m
(→‎{{header|AppleScript}}: Added straightforward solution and loopless integer range alternative.)
Line 228:
===Functional===
{{Trans|JavaScript}}( ES6 version )
<syntaxhighlight lang="applescript">--------------------- rootMeanSquareROOT ::MEAN [Num]SQUARE -> Real------------------
 
-- rootMeanSquare :: [Num] -> Real
on rootMeanSquare(xs)
script
Line 240 ⟶ 242:
 
 
-- TEST ---------------------------------------------- TEST -------------------------
on run
Line 249 ⟶ 251:
 
 
-- GENERIC FUNCTIONS --------------------------------------- GENERIC FUNCTIONS -------------------
 
-- foldl :: (a -> b -> a) -> a -> [b] -> a
Line 277 ⟶ 279:
<pre>6.204836822995</pre>
----
 
===Straightforward===
<syntaxhighlight lang="applescript">on rootMeanSquare(listOfNumbers)
9,655

edits