From: Andy Haywood
Subject: (* 353.0 0.01) = 3.5300000000002
Date: 
Message-ID: <3A0A856A.7E07C783@cwcom.net>
Why does

(* 353.0 0.01) => 3.5300000000002

but

(/ 353.0 (/ 1 0.01)) => 3.53

?

Andy

From: ········@hex.net
Subject: Re: (* 353.0 0.01) = 3.5300000000002
Date: 
Message-ID: <OcyO5.139934$bI6.5391192@news1.giganews.com>
Andy Haywood <···········@cwcom.net> writes:
> Why does
> 
> (* 353.0 0.01) => 3.5300000000002
> 
> but
> 
> (/ 353.0 (/ 1 0.01)) => 3.53
> 
> ?

You have just discovered the discipline of Numerical Analysis, the
area of computational mathematics in which you find that 1+1 is not
_exactly_ 2, at least not if you're working with imprecise values.

The critical thing that is happening here is that the conversion of
the fraction "1/100" into binary involves losing some precision, since
it cannot be exactly represented.  

As a result of that loss of precision, you will find that expressions
you'd _think_ should be identities in fact aren't.
-- 
(concatenate 'string "cbbrowne" ·@hex.net") <http://www.ntlug.org/~cbbrowne/>
(THASSERT (PLANNER RG))
                -- Example of HACKER statement.
From: Christopher J. Vogt
Subject: Re: (* 353.0 0.01) = 3.5300000000002
Date: 
Message-ID: <3A0AB8CA.B10CD0D3@computer.org>
········@hex.net wrote:
> 
> Andy Haywood <···········@cwcom.net> writes:
> > Why does
> >
> > (* 353.0 0.01) => 3.5300000000002
> >
> > but
> >
> > (/ 353.0 (/ 1 0.01)) => 3.53
> >
> > ?
> 
> You have just discovered the discipline of Numerical Analysis, the
> area of computational mathematics in which you find that 1+1 is not
> _exactly_ 2, at least not if you're working with imprecise values.

As my boss, Ken Smith, from 20 years ago said "One plus one is three 
for large values of one" after finding this nasty bug in some microcode.