comp.lang.ada
 help / color / mirror / Atom feed
From: "Vinzent Hoefler" <nntp-2010-09@t-domaingrabbing.de>
Subject: Re: Fixed point constants issue
Date: Fri, 24 Sep 2010 22:05:56 +0200
Date: 2010-09-24T22:05:56+02:00	[thread overview]
Message-ID: <op.vjjzf6t7d20q5n@jellix.jlfencey.com> (raw)
In-Reply-To: i7idee$8ag$1@speranza.aioe.org

On Fri, 24 Sep 2010 16:43:29 +0200, Markus Schöpflin <no@spam.spam> wrote:

>     TEN_FEET_1 : constant          := HEIGHT * FEET_PER_METER;
>     TEN_FEET_2 : constant ALTITUDE := HEIGHT * FEET_PER_METER;
> begin
>     ALTITUDE_IO.PUT (TEN_FEET_1); NEW_LINE; -- gives 3.0
>     ALTITUDE_IO.PUT (TEN_FEET_2); NEW_LINE; -- gives 5.0 (*)
> end FIXED_POINT;
> --->%---
>
> (*) This certainly looks like FEET_PER_METER is converted to ALTITUDE  
> before doing the multiplication.

Now that's interesting. Let me re-iterate: We have an Ada95 compiler  
behaving
as expected (although not necessarily intuitive) (GNAT), an Ada95 compiler
behaving like what's supposed to be an Ada83 difference (GreenHills, to
finally reveal the name), and now an Ada83 compiler behaving as if it were
an Ada95 compiler.

At least according to what I understood so far... seriously, I'm no less
confused than I was before.

> Another question regarding the implicit conversion from universal_real  
> to ALTITUDE: Does ARM83-3.5.6 apply here? And what does this mean: "If  
> the universal_real value is a safe number, the implicit conversion  
> delivers the corresponding value; if it belongs to the range of safe  
> numbers but is not a safe number, then the converted value can be any  
> value within the range defined by the safe numbers next above and below  
> the universal_real value." Is the compiler free to convert  
> FEET_PER_METER to either 0.0 or 0.5?

This would by my understanding, Ada95 puts it in different terms, but
basically the compiler seems to be allowed to choose any of both choices.

But IANALL (although today a call from my co-worker started with
"Ada Support there?" *g*).


Vinzent.

-- 
There is no signature.



  reply	other threads:[~2010-09-24 20:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13 17:27 Fixed point constants issue Vinzent Hoefler
2010-09-13 18:04 ` Dmitry A. Kazakov
2010-09-13 18:25   ` Vinzent Hoefler
2010-09-13 19:05     ` Niklas Holsti
2010-09-13 20:35       ` Vinzent Hoefler
2010-09-13 20:35       ` Jeffrey Carter
2010-09-13 21:06         ` Vinzent Hoefler
2010-09-14  5:39         ` Niklas Holsti
2010-09-24 14:43         ` Markus Schöpflin
2010-09-24 20:05           ` Vinzent Hoefler [this message]
2010-09-24 21:38           ` Jeffrey Carter
2010-09-24 22:42             ` Vinzent Hoefler
2010-09-25  0:16               ` Jeffrey Carter
2010-09-27 10:33                 ` Markus Schöpflin
2010-09-27 18:57                   ` Jeffrey Carter
2010-09-28  8:16                     ` Markus Schöpflin
2010-09-28 17:28                       ` Jeffrey Carter
2010-10-05  6:27                         ` Randy Brukardt
2010-10-05 18:40                           ` Jeffrey Carter
2010-09-27 17:58             ` Adam Beneschan
2010-09-13 20:32     ` Dmitry A. Kazakov
2010-09-13 21:08       ` Vinzent Hoefler
2010-09-14  6:54         ` J-P. Rosen
2010-09-14 18:28           ` Vinzent Hoefler
2010-09-14  7:47         ` Dmitry A. Kazakov
2010-09-14 17:42           ` Vinzent Hoefler
2010-09-15  8:35             ` Dmitry A. Kazakov
2010-09-15 17:24               ` Vinzent Hoefler
2010-09-15 20:11                 ` Dmitry A. Kazakov
2010-09-14 19:44   ` Keith Thompson
replies disabled

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