in reply to Re: minimum, maximum and average of a list of numbers at the same time
in thread minimum, maximum and average of a list of numbers at the same time
The logical conclusion:
use List::Util qw( sum ); sub min_max_avg { my ( $min, $max ) = ( sort { $a <=> $b } @_ )[ 0, -1 ]; return ( $min, $max, sum @_ ); }
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: minimum, maximum and average of a list of numbers at the same time
by BrowserUk (Patriarch) on Nov 10, 2005 at 20:56 UTC | |
by Aristotle (Chancellor) on Nov 10, 2005 at 21:57 UTC |