Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Finding the max()/min()

by elusion (Curate)
on Nov 11, 2004 at 02:48 UTC ( #406887=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub max {
        my ($max, @vars) = @_;
        for (@vars) {
    ...
        }
        return $max;
    }
    
  2. or download this
    sub max {
        my ($max, $next, @vars) = @_;
        return $max if not $next;
        return max( $max > $next ? $max : $next, @vars );
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (13)
As of 2015-06-03 16:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What kind of chocolate gives you the most pleasure?















    Results (137 votes), past polls