Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Finding the max()/min()

by Zaxo (Archbishop)
on Nov 11, 2004 at 02:38 UTC ( #406885=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # max
    my $max = ($x, $y)[$x < $y];
    
    # min
    my $min = ($x, $y)[$x > $y];
    
  2. or download this
    sub max ($$) { $_[$_[0] < $_[1]] }
    sub min ($$) { $_[$_[0] > $_[1]] }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-07-25 03:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls