comp.lang.ada
 help / color / mirror / Atom feed
From: stt@ada-uts
Subject: Re: Implicit conversion?
Date: 9 Mar 89 15:40:00 GMT	[thread overview]
Message-ID: <57900090@ada-uts> (raw)
In-Reply-To: 5678@sdcrdcf.sm.unisys.com


W.r.t.: X := MAX_INT - MAX_INT;
You are correct that formally the conversion to
tiny integer takes place at the leaves of the expression,
however 4.5:7 in the LRM states:
  The predefined operations on integer types either yield the
  mathematically correct result or raise the exception NUMERIC_ERROR.

Hence it is perfectly legal to perform intermediate calculations
with predefined operators using more accuracy than the declared type.
I suspect that most Ada compilers will evaluate "static" expressions
(see 4.9 for definition) with infinite precision, since
they are required to evaluate all static *universal* expressions
exactly.

S. Tucker Taft
Intermetrics, Inc.
Cambridge, MA  02138

  parent reply	other threads:[~1989-03-09 15:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5678@sdcrdcf.sm.unisys.com>
1989-03-08 16:38 ` Implicit conversion? Robert Eachus
1989-03-13 22:31   ` Steven Holtsberg
1989-03-09 15:40 ` stt [this message]
1989-03-17 18:11   ` Roger Racine
1989-03-18  9:46     ` Steven Holtsberg
replies disabled

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