On 04/08/2013 09:52 AM, Robert Dewar wrote:
On 4/8/2013 9:23 AM, Kenneth Zadeck wrote:
On 04/08/2013 09:19 AM, Robert Dewar wrote:
On 4/8/2013 9:15 AM, Kenneth Zadeck wrote:

I think this applies to Ada constant arithmetic as well.

Ada constant arithmetic (at compile time) is always infinite
precision (for float as well as for integer).

What do you mean when you say "constant arithmetic"?    Do you mean
places where there is an explicit 8 * 6 in the source or do you mean any
arithmetic that a compiler, using the full power of interprocedural
constant propagation can discover?

Somewhere between the two. Ada has a very well defined notion of
what is and what is not a "static expression", it definitely does not
include everything the compiler can discover, but it goes beyond just
explicit literal arithmetic, e.g. declared constants

   X : Integer := 75;

I actually guessed that it was something like this but i did not want to spend the time trying to figure this bit of ada syntax out.
are considered static. It is static expressions that must be computed
with full precision at compile time. For expressions the compiler can
tell are constant even though not officially static, it is fine to
compute at compile time for integer, but NOT for float, since you want
to use target precision for all non-static float-operations.


yes but the relevant question for the not officially static integer constants is "in what precision are those operations to be performed in? I assume that you choose gcc types for these operations and you expect the math to be done within that type, i.e. exactly the way you expect the machine to perform.

Reply via email to