Averages/Arithmetic mean: Difference between revisions
Content added Content deleted
(→{{header|RPL}}: remediated the dc-based version) |
Langurmonkey (talk | contribs) |
||
Line 1,981: | Line 1,981: | ||
We could use fold() to write a function that takes an array and calculates the mean. |
We could use fold() to write a function that takes an array and calculates the mean. |
||
{{works with|langur|0.6.6}} |
|||
<syntaxhighlight lang="langur">val .mean = f(.x) fold(f{+}, .x) / len(.x) |
<syntaxhighlight lang="langur">val .mean = f(.x) fold(f{+}, .x) / len(.x) |
||