From: Robert Klemme Date: 2009-05-06T20:06:11+09:00 Subject: Re: Unexpected BigDecimal rounding issue 2009/5/6 Samuel Lown : > > Rick Denatale wrote: >> On Tue, May 5, 2009 at 9:01 PM, Samuel Lown wrote: >>> >>> Can anyone offer an explanation? >> >> BigDecimal is still a kind of float, albeit a decimal float rather >> than a binary float. >> > > Many thanks Nobuyoshi and Rick, that makes complete sense now. > > I guess the safest rule of thumb is if you're doing comparisons for > humans, use humanized numbers (i.e. integers :-) Or define a maximum error, i.e. do not rely on identical values but rather the difference of the quotient. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/