Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Finding the max()/min()

by Aristotle (Chancellor)
on Dec 18, 2004 at 02:15 UTC ( #415817=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub max {
        my( $i, @l ) = @_;
        my $j = @l ? max( @l ) : $i;
        return $i > $j ? $i : $j;
    }
    
  2. or download this
    sub max {
        $_[ 0 ] < $_[ -1 ] ? shift : pop while @_ > 1;
        return @_;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://415817]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2014-09-17 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (55 votes), past polls