From: Rick DeNatale Date: 2007-06-23T04:12:17+09:00 Subject: Re: Ruby doesn't know how to multiply On 6/21/07, Adriano Ferreira wrote: > On 6/21/07, juan pedro meri�o wrote: > > You are rigth James, but you can better reponse why is a floating point > > error? > > > > Some numbers (like 0.1) cannot be represented exactly in binary with a > finite number of bits (because 0.1[base 10] = > 0.0001100110011001100110011...[base 2]) and when they are represented > (as it happens with floating point representations), they lose > precision Actually in any base there are fractions which cannot be represented with a FINITE number of digits. For instance in base 10: 1/3 = 0.33333333333....... -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/