sub median { my @sorted = sort { $a <=> $b } @_; ($sorted[$#sorted/2 + 0.1] + $sorted[$#sorted/2 + 0.6])/2; }
-- Randal L. Schwartz, Perl hacker
In reply to Re: how to find median value
by merlyn
in thread how to find median value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |