comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: choice of fixed point type
Date: 2000/03/06
Date: 2000-03-06T00:00:00+00:00	[thread overview]
Message-ID: <HITw4.4092$w9.85382@news.pacbell.net> (raw)
In-Reply-To: 8a0lm4$trr$1@nnrp1.deja.com

>(I thought GNAT 3.12p compiled, without warning, the example
>even when "type Duration is delta ..." was replaced with
>"type T is delta ...".  I don't have access to 3.12p right
>now, so I can't verify that.)
  Using "type D is delta ..." also fails to generate any warning.

>> The code in question is really non-portable at best, wrong
>> at worst, but not illegal if there is only one fixed-point
>> type visible. At least that's my reading.
  The code in question arose from testing around an "Ada
surprise".  An execution error had been traced to where a
programmer had written something like
  Long_Float(N * Ada.Numerics.pi)   instead of
  Long_Float(N) * Ada.Numerics.pi
resulting in the use of (relatively imprecise) type Duration
for the multiply instead of Long_Float.  Standard.Duration
was of course (silently) visible, and there was no other
fixed point type in this code, so the compiler did what the
programmer said, but not what he wanted.




      reply	other threads:[~2000-03-06  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-01  0:00 choice of fixed point type tmoran
2000-03-03  0:00 ` tmoran
2000-03-04  0:00   ` Richard D Riehle
2000-03-05  0:00     ` tmoran
2000-03-06  0:00       ` Robert Dewar
2000-03-06  0:00         ` David W. Glessner
2000-03-06  0:00           ` tmoran [this message]
replies disabled

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