in reply to Closest-value-in-list Golf!
Not the shortest, but this was what was obvious to me...
Chrissub c { #_123456789_123456789_123456789_123456789_12345 $i=pop;for(@_){$c=$_ if abs$i-$c>abs$i-$_}$c }
|
---|
In Section
Meditations