From: William James Date: 2007-09-04T07:20:10+09:00 Subject: Re: wierd floating point output Matthias W�chter wrote: > Stefan Rusterholz schrieb: > > Matthias W�chter wrote: > >> What I mean is that any float stored as a IEEE 754 double (64 bit), > >> like 0.1 with hex notation 0x3FB999999999999A should have a distinct > >> string representation such that (a==b) == (a.to_s==b.to_s). Note > >> that the next higher double 0.1+2.0**-56 with hex notation > >> 0x3FB999999999999B has the same .to_s representation, which is not good. > > I disagree. As long as you're calculating, you are working with floats > > anyway, so you have maximum precision. Comparing floats should be done > > using delta comparison anyway too. > > Which, as discussed in the 0.06 thread, is hard to accomplish nevertheless. Can you give some examples of pairs of floats that are hard to compare using delta comparison?