comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: fixed point vs floating point
Date: 1997/12/03
Date: 1997-12-03T00:00:00+00:00	[thread overview]
Message-ID: <dewar.881162947@merv> (raw)
In-Reply-To: 6632qf$m40$1@goanna.cs.rmit.edu.au


Robin says

<<Rubbish.  If evaluation of this expression fails, it
is because of exceeding the capacity of the fixed-point
multiplier.  It has -- incidentally -- nothing to do
with the division.

The above is the WRONG way to compute an expression
using fixed-point facilities.

You would write it x = (y * V1) / V3;
>>

No that's quite wrong, the fixed point expressions

   y * (V1 / V3)

and

   (y * V1) / V3

are quite different expressions (to substitute one for the other, for
example in the computation of interest in a bond, would not only be
an error, but might actually be a violation of the law, since the
details of such calculations are often contained in the bond instruments
and mandated).

These two expressions give quite different values, it is wrong to say
that one is right and one is wrong. Which one is right depends on the
problem at hand, and the intermediate precision required in both cases
must be carefully controlled.

I can easily see how the fixed-point facilities in PL/1 would seduce
PL/1 enthusiasts into such errors. It is one of the reasons that the
fixed-point design in PL/1 is generally considered a failure. Please
note I am talking a very specific language design point here. I quite
realize that most language designers consider the whole of PL/1 a
dismal failure, but I don't go that far, PL/1 is not nearly as bad
as its reputation, but it did make a number of serious mistakes,
and the fixed-point design was one of them.





  reply	other threads:[~1997-12-03  0:00 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-02  0:00 fixed point vs floating point Robert Dewar
1997-12-02  0:00 ` Joe Gwinn
1997-12-02  0:00   ` Ken Garlington
1997-12-03  0:00     ` Joe Gwinn
1997-12-04  0:00       ` Robert Dewar
1997-12-04  0:00         ` Shmuel (Seymour J.) Metz
1997-12-02  0:00   ` Robert Dewar
1997-12-02  0:00     ` Matthew Heaney
1997-12-03  0:00       ` Robert Dewar
1997-12-03  0:00     ` robin
1997-12-03  0:00       ` Robert Dewar [this message]
1997-12-03  0:00     ` Shmuel (Seymour J.) Metz
1997-12-03  0:00       ` Matthew Heaney
1997-12-04  0:00         ` Shmuel (Seymour J.) Metz
1997-12-04  0:00           ` Robert Dewar
1997-12-03  0:00       ` Robert Dewar
1997-12-03  0:00       ` Robert Dewar
1997-12-03  0:00 ` robin
  -- strict thread matches above, loose matches on Subject: below --
2011-09-29 10:25 RasikaSrinivasan@gmail.com
2011-09-29 10:49 ` AdaMagica
2011-09-29 13:38   ` Martin
2011-09-30 10:17 ` Stephen Leake
2011-09-30 16:25   ` tmoran
2011-09-30 16:52     ` Dmitry A. Kazakov
2011-10-01 11:09     ` Stephen Leake
2011-09-30 19:26   ` tmoran
2011-09-30 22:31   ` tmoran
2011-10-01 13:37   ` RasikaSrinivasan@gmail.com
2011-10-02 14:19     ` Stephen Leake
1997-11-28  0:00 tmoran
1997-11-28  0:00 ` Robert Dewar
1997-11-27  0:00 tmoran
1997-11-27  0:00 ` Robert Dewar
1997-11-29  0:00   ` Tarjei T. Jensen
     [not found] <9711221603.AA03295@nile.gnat.com>
1997-11-22  0:00 ` Ken Garlington
1997-11-22  0:00 Matthew Heaney
1997-11-22  0:00 ` Tucker Taft
1997-11-22  0:00   ` Robert Dewar
1997-11-22  0:00     ` Matthew Heaney
1997-11-23  0:00 ` Geert Bosch
1997-11-23  0:00   ` Matthew Heaney
1997-11-23  0:00     ` Robert Dewar
1997-11-24  0:00       ` Herman Rubin
1997-11-24  0:00         ` Robert Dewar
1997-11-25  0:00           ` Joe Gwinn
1997-11-25  0:00             ` Matthew Heaney
1997-11-25  0:00             ` Robert Dewar
1997-11-25  0:00               ` Joe Gwinn
1997-11-25  0:00                 ` Robert Dewar
1997-11-26  0:00                   ` Joe Gwinn
1997-11-26  0:00                     ` Robert Dewar
1997-12-01  0:00                       ` Joe Gwinn
1997-12-01  0:00                         ` Robert Dewar
1997-12-01  0:00                           ` Joe Gwinn
1997-12-03  0:00                           ` robin
1997-11-26  0:00             ` William A Whitaker
1997-11-24  0:00     ` Geert Bosch
1997-11-23  0:00   ` Tom Moran
1997-11-25  0:00     ` John A. Limpert
1997-11-25  0:00       ` Robert Dewar
1997-11-25  0:00       ` Robert Dewar
1997-11-24  0:00 ` Vince Del Vecchio
1997-11-24  0:00 ` Vince Del Vecchio
1997-12-03  0:00 ` robin
replies disabled

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