Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2016-12-03 21:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (60 votes). Check out past polls.