From: Martin DeMello Date: 2007-02-08T05:13:19+09:00 Subject: Re: Algorithm Help - Grid Space Calculations On 2/8/07, Phrogz wrote: > factor in particular). And even though you transcribed into Ruby what > I wrote in English with the "nearest to the current setting" > constraint, for some reason I couldn't come up with it. That was where I really missed the oft-requested min_by: $grid_spacing = [high, low].min_by {|i| ($grid_spacing - i).abs} but I felt defining it for that one use would be overkill :) martin