Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
(define ((simple-moving-averager size . nums) num)
|
||||
(set! nums (cons num (if (= (length nums) size) (reverse (cdr (reverse nums))) nums)))
|
||||
(/ (apply + nums) (length nums)))
|
||||
|
||||
(define av (simple-moving-averager 3))
|
||||
(map av '(1 2 3 4 5 5 4 3 2 1))
|
||||
Loading…
Add table
Add a link
Reference in a new issue