Simple examples: Difference between revisions

Jump to navigation Jump to search
395 bytes removed ,  22:44, 27 June 2020
Remove faulty part
m (→‎Operators: mistake)
(Remove faulty part)
Line 47: Line 47:
       (+⌿÷≢) 3 4.5 7 21
       (+⌿÷≢) 3 4.5 7 21
8.875
8.875
</source>
The operator <source lang=apl inline>⌿</source> can also be used to modify the <source lang=apl inline>(+⌿÷≢)</source> function to produce a moving average.
<source lang=apl>
      2 (+⌿÷≢)/ 3 4.5 7 21
3.75 5.75 14
</source>
or, more verbosely
<source lang=apl>
      ave ← +⌿÷≢
      ave 3 4.5 7 21
8.875
      mave ← ave⌿
      2 mave 3 4.5 7 21
3.75 5.75 14
</source>
</source>


Navigation menu