comp.lang.ada
 help / color / mirror / Atom feed
From: Al Christians <achrist@easystreet.com>
Subject: Re: financial computations
Date: 2000/05/09
Date: 2000-05-09T00:00:00+00:00	[thread overview]
Message-ID: <3918A193.9800E973@easystreet.com> (raw)
In-Reply-To: 8f9o7c$q3o$1@nnrp1.deja.com

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 ....




  reply	other threads:[~2000-05-09  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-08  0:00 financial computations Christoph Seelhorst
2000-05-08  0:00 ` Robert Dewar
2000-05-08  0:00 ` Gautier
2000-05-09  0:00 ` Marin D. Condic
2000-05-09  0:00   ` Robert Dewar
2000-05-09  0:00     ` Marin D. Condic
2000-05-09  0:00       ` Robert Dewar
2000-05-09  0:00     ` Al Christians
2000-05-09  0:00       ` Robert Dewar
2000-05-09  0:00         ` Al Christians [this message]
2000-05-09  0:00           ` DuckE
2000-05-10  0:00             ` Robert Dewar
2000-05-10  0:00           ` Robert Dewar
2000-05-10  0:00             ` Al Christians
2000-05-10  0:00               ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox