Anonymous user
Averages/Pythagorean means: Difference between revisions
Update to work with version 1.4 of Nim. Changed the output to match the actual format.
(Added Wren) |
(Update to work with version 1.4 of Nim. Changed the output to match the actual format.) |
||
Line 2,091:
=={{header|Nim}}==
<lang nim>import math, sequtils,
proc amean(num: seq[float]): float =
Line 2,112:
proc hmeanFunctional(num: seq[float]): float =
float(num.len) / sum(num.mapIt(
let numbers = toSeq(1..10).map((x: int) => float(x))
echo amean(numbers), " ", gmean(numbers), " ", hmean(numbers)</lang>
{{out}}
<pre>5.
=={{header|Oberon-2}}==
|