From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_20,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c872b4c479fe6a9b X-Google-Attributes: gid103376,public From: Al Christians Subject: Re: financial computations Date: 2000/05/09 Message-ID: <3918A193.9800E973@easystreet.com>#1/1 X-Deja-AN: 621341508 Content-Transfer-Encoding: 7bit References: <391725AA.4F68ED72@gmx.de> <39182D26.F4FDB0F8@quadruscorp.com> <8f93qg$1g9$1@nnrp1.deja.com> <39182A7C.C1358EE2@easystreet.com> <8f9o7c$q3o$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse@supernews.com Organization: Trillium Resources Corporation MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-05-09T00:00:00+00:00 List-Id: Robert Dewar wrote: > in several contexts, including bond interest > calculations, the calculation of interest must be done precisely > in decimal arithmetic, with specified truncation or rounding > semantics. You can only approximate this in floating-point. That's not quite the same thing as illegal, is it? With 64-bit mantissae available in several programming languages, including Ada according to GNAT, if I know the rules, I can approximate this stuff for a million lifetimes before I lose a cent. Realistically, I expect that when I do lose that penny there will be some character at hand who will point out the error and gloat without mercy. I would hate to deny him that pleasure. It's like playing solitaire. If I always did it according to the book, what would the kibitzers do? How could I sustain my humility without at least one grievous error per eon? > > > COBOL has no defined semantics for exponentiation, so I do not > know what you are talking about here at all. > Let me practice some mentalism, go a little deeper into my catatonic trance, and look deep into our past .... I see a COBOL compiler ... I see ADD ... I see SUBTRACT ... I see MULTIPLY ... I see DIVIDE ... but I don't see EXPONENTIATE. Could be you are right about this one, Robert. But wait, what's this? I see COMPUTE ... It has expressions ... It has arithmetic operators ... It has +, -, /, *, and, aha, ** for exponentiation ... and ** is very, very slow. When I wake up it will be almost finished ....