Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Finding the max()/min()

by Zed_Lopez (Chaplain)
on Nov 11, 2004 at 17:49 UTC ( #407128=note: print w/ replies, xml ) Need Help??


in reply to Finding the max()/min()

There's also the Quantum::Superpositions approach:

sub min { eigenstates( any(@_) <= all(@_) ) } sub max { eigenstates( any(@_) >= all(@_) ) }

In the real world, I'd use List::Util::max; if I wrote my own, it'd be this small variation on solutions above:

sub max { my $max = shift; $max = $max > $_ ? $max : $_ for @_; return $max }


Comment on Re: Finding the max()/min()
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2014-11-23 18:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (134 votes), past polls