From: Stefan Rusterholz Date: 2007-10-30T07:51:41+09:00 Subject: Re: find the closest items in an array to a given value. trebor777 wrote: > Hi! > > I'm searching for a light method for finding the closest items to a > given > value. [1,2,3,4,5,6].min { |a,b| (a-value).abs <=> (b-value).abs } Regards Stefan -- Posted via http://www.ruby-forum.com/.