Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!snorkelwacker.mit.edu!bloom-beacon!eru!kth.se!electra!pausch From: pausch@saaf.se (Paul Schlyter) Newsgroups: comp.sys.handhelds Subject: Re: How accurate is the 48?? Message-ID: <1991May21.120147.4627@saaf.se> Date: 21 May 91 12:01:47 GMT References: <7174@acorn.co.uk> Distribution: comp Organization: SAAF, Svensk Amat|rAstronomisk F|rening Lines: 32 In article <7174@acorn.co.uk> asmith@acorn.co.uk (Andy Smith) writes: >There is no doubt that the 28S and the 48SX are brilliant calculators, but >one thing still puzzles me. Certainly with the 28S, although much better >than most calculators (3/3=1, 2/3*3=1) it is still not "accurate" due to the >limitations of how it stores numbers. 1/3*3 still gives 0.999999999. Does >the 48 still suffer from this limitation? Of course. THis is a limitation inherent in using BCD representaion for floating-point numbers. 1/3 is 0.33333333....... infinetley, so it must be rounded off somewhere. Suppose we round off after 12 digits: 0.333333333333 Now we want to multiply this with 3 - the answer to this IS 0.999999999999 to 12 decimal places. If one decides to always round up 0.999999999999 to 1.0000000000 just to get 1/3*3 right, one is faced with another problem: 3 * 0.333333333333 will then yield the result 1.0000000000 instead of the correct result 0.999999999999 . How do you handle this problem? The simple fact that one must live with is that ALL floating-point arithmetic may introduce round-off errors (unless one computes with infinite precision, which for practical reasons are impossible). By using BCD instead of pure binary floating-point numbers one is assured that things like 1/10*10 will always be exactly right, but that's only because 10 is the internal base for the floating-point number. The round-off errors still sometimes shows up, like in 1/3*3. There's really nothing you can do about it, without introducing other undesireable side-effects. -- --- Paul Schlyter, Swedish Amateur Astronomer's Society (SAAF) InterNet: pausch@saaf.se FidoNet: 2:201/600.2