Update:sub g {(sort{abs$a-$_[1]<=>abs$b-$_[1]}@{$_[0]})[0]} # 44 chars
fantastic - that's exactly half my originalsub g {$n=pop;(sort{abs$a-$n<=>abs$b-$n}@_)[0]} # 39 chars
"Argument is futile - you will be ignorralated!"
In reply to uneven abs!
by larryk
in thread Closest-value-in-list Golf!
by larryk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |