Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!husc6!m2c!ernie.viewlogic.com!hari!peter From: peter@hari.Viewlogic.COM (Peter Colby) Newsgroups: comp.sys.mac.programmer Subject: Re: Why can't the Mac add? Message-ID: <1990Sep25.091831@hari.Viewlogic.COM> Date: 25 Sep 90 13:18:31 GMT References: <45060@apple.Apple.COM> <20360@dime.cs.umass.edu> <45108@apple.Apple.COM> Sender: news@viewlogic.com (News Administrator) Reply-To: peter@hari.Viewlogic.COM (Peter Colby) Organization: Viewlogic Systems, Inc., Marlboro, MA Lines: 19 In article <45108@apple.Apple.COM>, das@Apple.COM (David Shayer) writes: |> The calculator DA can do this math correctly. If you add 0.2 fifty |> times, you get 10.0. Exactly. Not 9.999999 or 10.0000001. I tried |> changing my float variable to an extended, as someone suggested. No dice. |> Does the calculator DA have its own special math package? (If so, the |> dCad calculator does too.) No one seems to think SANE has calls which |> take care of this. So why does it work in the calculator? I would have to assume that the calculator DA actually uses fixed point rather than floating point arithmetic. Fixed point is exact because you can represent any number as an integer! Of course, you have to limit the size of both the exponent and the mantissa or you end up back in the infinite precision trap again. -- (O)(O)(O)(O)(O)(O)(O)(O)(O) (O)(O)(O)(O)(O)(O)(O)(O)(O) (O) !the doctor is out! (O) (0) peter@viewlogic.com (0) (O)(O)(O)(O)(O)(O)(O)(O)(O) (O)(O)(O)(O)(O)(O)(O)(O)(O)