in reply to uneven abs!
in thread Closest-value-in-list Golf!
However if I am allowed to rearrange the arguments, I find it more natural that any special arguments should come first in the list. Giving a 38 character solution:
sub g { (sort{abs$a-$_[0]<=>abs$b-$_[0]}@_)[1] }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re (tilly) 1: uneven abs!
by larryk (Friar) on May 29, 2001 at 22:57 UTC |