RosettaCodeData/Task/Averages-Arithmetic-mean/Nemerle/averages-arithmetic-mean.nemerle
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

17 lines
314 B
Text

using System;
using System.Console;
using Nemerle.Collections;
module Mean
{
ArithmeticMean(x : list[int]) : double
{
|[] => 0.0
|_ =>(x.FoldLeft(0, _+_) :> double) / x.Length
}
Main() : void
{
WriteLine("Mean of [1 .. 10]: {0}", ArithmeticMean($[1 .. 10]));
}
}