Daniel Berger wrote:
> 
> On Aug 31, 12:25 am, Michael Ulm <michael.... / isis-papyrus.com> wrote:
> 
> <snip>
> 
>> Unfortunately, there is no easy solution to this problem.
> 
> <snip>
> 
> Here's my naive, DWIM approach:
> 
> class Float
>    def ==(other)
>       self.to_s == other.to_s
>    end
> end
> 

Oh yes, nice one. This fulfills 

'from  x==y and y==z follows x==z'

Unfortunately it does not fulfill some other properties one
wants to have; e.g. it violates

'from x==y follows x+z==y+z'

for example

> x, y = 1.0/3.0, 0.333333333333333
> x.to_s == y.to_s # => true
> (x+x).to_s == (y+x).to_s # => false

In particular, you don't have

'from x==y follows x-y==0'

for example

> x, y = 0.6, 6 * 0.1
> x.to_s == y.to_s # => true
> (x - y).to_s == 0.to_s # => false

HTH,

Michael