Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
P is for Practical
 
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 pondering the Monastery: (9)
As of 2014-04-16 05:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (414 votes), past polls