June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -0,0 +1,24 @@
|
|||
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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue