Averages/Arithmetic mean: Difference between revisions

Added Limbo
(→‎{{header|Python}}: stdlib statistics module)
(Added Limbo)
Line 1,608:
print "Arithmetic mean: ";mean
</lang>
=={{header|Limbo}}==
<lang Limbo>implement Command;
 
include "sys.m";
sys: Sys;
 
include "draw.m";
 
include "sh.m";
 
init(nil: ref Draw->Context, nil: list of string)
{
sys = load Sys Sys->PATH;
 
a := array[] of {1.0, 2.0, 500.0, 257.0};
sys->print("mean of a: %f\n", getmean(a));
}
 
getmean(a: array of real): real
{
n: real = 0.0;
for (i := 0; i < len a; i++)
n += a[i];
return n / (real len a);
}</lang>
 
=={{header|LiveCode}}==