Xref: utzoo comp.lang.c:30924 comp.lang.misc:5322 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!usc!samsung!emory!stiatl!srchtec!johnb From: johnb@srchtec.UUCP (John Baldwin) Newsgroups: comp.lang.c,comp.lang.misc Subject: Re: Floating point exactness & alternatives (summary) Message-ID: <168@srchtec.UUCP> Date: 8 Aug 90 22:36:39 GMT References: <713@tetrauk.UUCP> <1990Aug7.173030.2823@zoo.toronto.edu> Followup-To: comp.lang.c Organization: search technology, inc. Lines: 30 In article <1990Aug7.173030.2823@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >In article <713@tetrauk.UUCP> rick@tetrauk.UUCP (Rick Jones) writes: >> Auditors have this annoying view that accounts must balance to the >>penny, not 1 part in 10 to-the-something. There is a good case for using some >>form of BCD representation, but there are many programming advantages in using >>the embedded numerical types of the language... > >Our own experience, in building accounting systems for our own use, is that >the problem can often be eliminated by ignoring the decimal point in dollar >currencies and thinking of money as measured in pennies. Doesn't this push him back into the "continued sums" implementation? Remember, conversion rates between different currencies "slide" up and down at a fairly high frequency. (Does anybody know just HOW frequently the exchange rates change?) This would require an INTERNAL currency which would probably NOT be the same as a recognized world currency; one in which any unit of any other world currency can be expressed as an integer. This is probably tricky enough to find WITHOUT having the conversions changing on you all the time! Rick: how many currencies do you have to deal with and how often do they change? Maybe this *would* be a feasible approach: if the numbers are too big for a (long), store them in a struct. Have a multidimensional array of structs containing numerators and denominators for conversions. -- John T. Baldwin | johnb@srchtec.uucp Search Technology, Inc. | johnb%srchtec.uucp@mathcs.emory.edu standard disclaimer: | ...uunet!samsung!emory!stiatl!srchtec.. opinions and mistakes purely my own. | ...mailrus!gatech!stiatl!srchtec...