Averages/Arithmetic mean: Difference between revisions
Content added Content deleted
(→{{header|AutoHotkey}}: ++ amigae) |
(added slate language) |
||
Line 591: | Line 591: | ||
> (mean (list 3 1 4 1 5 9)) |
> (mean (list 3 1 4 1 5 9)) |
||
3 5/6 |
3 5/6 |
||
=={{header|Slate}}== |
|||
<lang slate> |
|||
[|:list| (list reduce: #+ `er ifEmpty: [0]) / (list isEmpty ifTrue: [1] ifFalse: [list size])] applyWith: #(3 1 4 1 5 9). |
|||
[|:list| (list reduce: #+ `er ifEmpty: [0]) / (list isEmpty ifTrue: [1] ifFalse: [list size])] applyWith: {}. |
|||
</lang> |
|||
=={{header|Smalltalk}}== |
=={{header|Smalltalk}}== |