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

(boo)Re: Re: Closest-value-in-list Golf -- or, a sorted affair.

by boo_radley (Parson)
on May 29, 2001 at 18:38 UTC ( #83949=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sort{$a<=>$b}keys%h
    
  2. or download this
    sub g {$n=pop;$h{abs($_-$n)}=$_ for@_;$h{(sort keys%h)[0]}}
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2018-12-11 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (52 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!