From: Gavin Sinclair Date: 2002-12-28T23:05:00+09:00 Subject: Re: 1210 / 100 = 12? what? On Saturday, December 28, 2002, 8:08:55 PM, Yohanes wrote: > class Float > @@tolerance = 1E-6 #adjust this as needed > def around?(other) > other = other.to_f unless other.is_a? Float > (other-self).abs < @@tolerance > end > end > > YS. A small point of order. What's the point of this line? other = other.to_f unless other.is_a? Float It would be more efficient (I believe) and certainly neater to just call other.to_f unconditionally, viz. def around?(other) (other.to_f - self).abs < @@tolerance end Cheers, Gavin