Xref: utzoo comp.lang.smalltalk:627 comp.sources.wanted:4584 Path: utzoo!attcan!uunet!husc6!uwvax!rutgers!bellcore!tness7!killer!vector!rpp386!jfh From: jfh@rpp386.UUCP (John F. Haugh II) Newsgroups: comp.lang.smalltalk,comp.sources.wanted Subject: Re: Fixed Point (Decimal) Arithmetic Requested Keywords: Smalltalk, Arithmetic Message-ID: <4090@rpp386.UUCP> Date: 17 Jul 88 14:42:30 GMT References: <442@laura.UUCP> <198@skep2.ATT.COM> Reply-To: jfh@rpp386.UUCP (The Beach Bum) Organization: Big "D" Home for Wayward Hackers Lines: 29 In article <198@skep2.ATT.COM> wcs@skep2.UUCP (46323-Bill.Stewart.[ho95c],2G218,x0705,) writes: >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. this is cobol's domain. all cobol implementations i've used allow you do declare something like 05 total-federal-deficit pic 9(15).99 05 annual-federal-deficit pic 9(12).99 and regardless of floating point word size get accurate results if you add this years deficit to last years. double words (32 bit) only yield seven digits at best, and even quad words (64 bit) yield only 15 digit accuracy. no one ever said cobol was fast, but if those damned beancounters want their pennies, go find a cobol compiler. - john. -- John F. Haugh II +--------- Cute Chocolate Quote --------- HASA, "S" Division | "USENET should not be confused with UUCP: killer!rpp386!jfh | something that matters, like CHOCOLATE" DOMAIN: jfh@rpp386.uucp | -- with my apologizes