Jump to content

Averages/Simple moving average: Difference between revisions

→‎E: update to actual output, with scrollbar
(→‎{{header|TI-83 BASIC}}: translated for TI-89, marked incorrect for not being stateful)
(→‎E: update to actual output, with scrollbar)
Line 176:
}</lang>
 
<div style="overflow: auto; max-height: 12em;"><lang e>? for period in [3, 5] {
> def [insert, average] := makeMovingAverage(period)
> println(`Period $period:`)
Line 185:
> println()
> }
 
0.0
Period 3:
1 1.0
0.9428090415820626
2 1.5
0.8660254037844386
3 2.0
0.9797958971132716
14 3.0
5 4.0
1.3997084244475297
5 4.666666666666667
2.0</lang>
4 4.666666666666667
3 4.0
2 3.0
1 2.0
 
Period 5:
1 1.0
2 1.5
3 2.0
4 2.5
5 3.0
5 3.8
4 4.2
3 4.2
2 3.8
1 3.0
2.0</lang></div>
 
=={{header|Forth}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.