From: ara.t.howard@... Date: 2006-07-08T01:09:09+09:00 Subject: Re: Float#==. Legacy? On Sat, 8 Jul 2006, Tim Pease wrote: > Martin, I like the syntax. To make it more like Float#== > > class Float > def =~( other ) > epsilon_eql?(coerce(other), EPSILON) > end > > def epsilon_eql?( other, epsilon ) > return false unless other.instance_of? self.class > ((other-self)/other).abs <= epsilon > end > end > > I think this gives the best of both worlds. A simple =~ syntax for > using the default epsilon, and the slightly less elegant epsilon_eql? > syntax when you want to sepcify your own. > > Blessings, > TwP hi guys- i've written this at least 10 times - how bout an rcr? -a -- suffering increases your inner strength. also, the wishing for suffering makes the suffering disappear. - h.h. the 14th dali lama