Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

uneven abs!

by larryk (Friar)
on May 29, 2001 at 18:52 UTC ( #83964=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub g {(sort{abs$a-$_[1]<=>abs$b-$_[1]}@{$_[0]})[0]} # 44 chars
    
  2. or download this
    sub g {$n=pop;(sort{abs$a-$n<=>abs$b-$n}@_)[0]} # 39 chars
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://83964]
help
Chatterbox?
[LanX]: Moon not Mars
Corion updates his location info to "I'm needed everywhere"
[choroba]: needed everywhere, available rarely

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (17)
As of 2017-03-27 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.