Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 pool shimmers...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2017-05-27 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?