Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,8 @@
fcn SMA(P){
fcn(n,ns,P){
sz:=ns.append(n.toFloat()).len();
if(P>sz) return(0.0);
if(P<sz) ns.del(0);
ns.sum(0.0)/P;
}.fp1(List.createLong(P+1),P) // pre-allocate a list of length P+1
}

View file

@ -0,0 +1,2 @@
T(1,2,3,4,5,5,4,3,2,1).apply(SMA(3)).println();
T(1,2,3,4,5,5,4,3,2,1).apply(SMA(5)).println();