Xref: utzoo comp.lang.smalltalk:626 comp.sources.wanted:4580 Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!tut.cis.ohio-state.edu!rutgers!att!skep2!wcs From: wcs@skep2.ATT.COM (Bill.Stewart.[ho95c]) Newsgroups: comp.lang.smalltalk,comp.sources.wanted Subject: Re: Fixed Point (Decimal) Arithmetic Requested Keywords: Smalltalk, Arithmetic Message-ID: <198@skep2.ATT.COM> Date: 16 Jul 88 18:46:24 GMT References: <442@laura.UUCP> Reply-To: wcs@skep2.UUCP (46323-Bill.Stewart.[ho95c],2G218,x0705,) Organization: AT&T Bell Labs Center 4632, Holmdel, NJ Lines: 21 In article <442@laura.UUCP> georg@unido.UUCP (Georg A. M. Heeg) writes: :As basic technology we need decimal fixed point arithmetic. :The fiscal office certainly does not accept rounding errors through :floating point arithmetic.... Surprise! You'll get roundoff errors just as badly in fixed decimal, if you ever do interest rates or division. Suppose you have an annual interest rate of 10%, and need to calculate monthly payments. The monthly rate is .0833333333..., which will be represented much more accurately by floating-point than by fixed-point. You can process the calculations in floating point, and use an appropriate rounding algorithm for print statements. A more serious problem is precision - 32 bits is not enough, so double-precision floating point becomes useful. If you do your calculations in exact pennies/pfennig, the maximum amount of money you can process is about 20 million dollars/marks, which is not enough for larger businesses. -- # Thanks; #Bill Stewart, AT&T Bell Labs 2G218 Holmdel NJ 201-949-0705 ho95c.att.com!wcs