Averages/Root mean square: Difference between revisions
Content deleted Content added
→{{header|Haskell}}: Used Data.List.genericLength in lieu of (fromIntegral . length) |
→{{header|Clojure}}: Removed dependency and use the built in function - works copy/paste in any vanilla clojure repl, whereas before, you needed to edit a project.clj file not documented |
||
Line 347: | Line 347: | ||
=={{header|Clojure}}== |
=={{header|Clojure}}== |
||
<lang clojure> |
<lang clojure> |
||
(defn rms [xs] |
(defn rms [xs] |
||
(sqrt (/ (reduce + (map #(* % %) xs)) |
(Math/sqrt (/ (reduce + (map #(* % %) xs)) |
||
(count xs)))) |
(count xs)))) |
||