Anonymous user
Averages/Simple moving average: Difference between revisions
m
→{{header|REXX}}: changed/added comments and whitespace, changed indentations.
m (→{{header|REXX}}: changed the wording in the REXX section header.) |
m (→{{header|REXX}}: changed/added comments and whitespace, changed indentations.) |
||
Line 3,328:
The 1<sup>st</sup> and 2<sup>nd</sup> periods (number of values) were parametrized, as well as the total number of values.
<lang rexx>/*REXX program
parse arg p q n . /*obtain optional arguments from the CL*/
if p=='' | p=="," then p= 3 /*
if q=='' | q=="," then q= 5 /* "
if n=='' | n=="," then n=10 /*
@.=0 /*
do m=1 for n
end /*m*/
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
SMA:
end
▲ return $/i</lang>
'''output''' using the generated default list of numbers:
<pre>
|