Averages/Median: Difference between revisions
Content deleted Content added
Underscore (talk | contribs) m →{{header|Perl}}: Slightly shortened. |
Underscore (talk | contribs) →{{header|Perl 6}}: Replaced with a briefer implementation in the style of the Perl 5 and Python. |
||
Line 478:
=={{header|Perl 6}}==
{{works with|Rakudo|#22 "Thousand Oaks"}}
<lang perl6>sub median {
my @a = sort @_;
return (@a[@a.end / 2] + @a[@a / 2]) / 2;
}</lang>
=={{header|Python}}==
|