Anonymous user
Averages/Arithmetic mean: Difference between revisions
Added Q solution.
(Add min) |
(Added Q solution.) |
||
Line 2,616:
>>> mean([Decimal(big), Decimal(-big), 3, 1, 4, 1, 5, 9, 1/Decimal(big), -1/Decimal(big)])
Decimal('2.3')</lang>
=={{header|Q}}==
A built-in solution is <tt>avg</tt>. An implementation of it could be:
<lang q>mean:{(sum x)%count x}</lang>
=={{header|R}}==
|