Averages/Arithmetic mean: Difference between revisions
Content deleted Content added
Line 2,266: | Line 2,266: | ||
=={{header|Oforth}}== |
=={{header|Oforth}}== |
||
Oforth |
<lang Oforth>: avg ( x -- avg ) |
||
x sum |
|||
x size dup ifZero: [ 2drop null ] else: [ >float / ] |
|||
⚫ | |||
;</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
⚫ | |||
2.372 |
2.372 ok |
||
⚫ | |||
[ ] avg . |
|||
⚫ | |||
</pre> |
</pre> |
||