comp.lang.ada
 help / color / mirror / Atom feed
From: wemagor@sym1.cca.rockwell.com_nospam (Wayne Magor)
Subject: Re: Fixed point design error in Ada95
Date: 1998/09/10
Date: 1998-09-10T00:00:00+00:00	[thread overview]
Message-ID: <6t9dlk$e0t1@onews.collins.rockwell.com> (raw)
In-Reply-To: 6t93vn$g8l$1@nnrp1.dejanews.com


dewarr@my-dejanews.com writes:

>Actually this is to be honest less annoying than you might
>think. Unless you are using fixed-point as "poor man's
>floating-point" [a dubious proposition now that virtually
>all processors do floating-point faster than fixed-point],
>it makes little sense to do something like
>
>   function "*" (x,y : dollars_cents) return dollars_cents;
>
>since, as in this case, there is an obvious conceptual
>type error in this declaration.


I'll certainly agree with you that there aren't a lot of uses for
fixed-point operator overloading.

We are running host-based simulations of avionics systems which run
on a special avionics processor.  That processor does not have
floating point, but has something called fractional arithmetic.

The fractional arithmetic does not work exactly the same way as
Ada's fixed point.  There is no overflow detection with this
hardware, which is why the operator must be overloaded in order
to properly simulate the way the software will operate in the
target.  The target compiler is an Ada83 compiler, but the host
compiler is an Ada95 compiler.

It is unfortunate that Ada95 is not 100% backward compatible in
this area, even if it has little impact on the user community.

A pragma to give Ada83 operation would be a good solution.

Thanks,
Wayne.




  reply	other threads:[~1998-09-10  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-09  0:00 Fixed point design error in Ada95 Wayne Magor
1998-09-10  0:00 ` Tucker Taft
1998-09-10  0:00   ` dewarr
1998-09-10  0:00     ` Wayne Magor [this message]
1998-09-12  0:00       ` dewarr
1998-09-11  0:00     ` GNAT Professional ? Mats Weber
1998-09-11  0:00       ` dewarr
1998-09-12  0:00         ` Paul Whittington
1998-09-14  0:00           ` Al Christians
1998-09-14  0:00           ` dewarr
1998-09-15  0:00             ` Paul Whittington
1998-09-15  0:00               ` Markus Kuhn
1998-09-15  0:00               ` Peter Hermann
1998-09-15  0:00                 ` dewarr
1998-09-11  0:00       ` dennison
1998-09-11  0:00   ` Fixed point design error in Ada95 Wayne Magor
1998-09-11  0:00     ` dewarr
1998-09-12  0:00       ` Robert I. Eachus
1998-09-12  0:00         ` dewarr
1998-09-17  0:00           ` Robert I. Eachus
replies disabled

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