comp.lang.ada
 help / color / mirror / Atom feed
From: djs@actnyc.UUCP (Dave Seward)
Subject: Re: Alsys compiler bugs???
Date: 10 Jun 88 23:24:01 GMT	[thread overview]
Message-ID: <960@actnyc.UUCP> (raw)
In-Reply-To: 8806081155.AA02381@wooglin.scc.com

In article <8806081155.AA02381@wooglin.scc.com> chuck@WOOGLIN.SCC.COM (Charles Williams) writes:
>15    type Fix is delta 0.01 range -1.0 .. 1.0;
>16    My_Fixed : Fix := Fix'Last;
>                        ^______^
>                        1      1
>1 :   *EXP Value outside the range of the target type. NUMERIC_ERROR will be
>            raised if executed.
>
>This error is very confusing to me as the syntax appears perfectly legal and
>the operation also looks fine.
>...and who's wrong? and more importantly, why?

Fixed point has several tricky points like this. In the simplest terms, the
delta implies a "small" value, usu. a power of 2, in this case 2.0**(-7).
The representable values of the type are integral multiples of the small value.
The specified bounds, ie -1.0 and +1.0, don't have to be representable, as
long as they are within small of being representable. In this case, the largest
representable number is (1.0 - 2.0**(-7)). The logic for this is discussed
in 3.5.9(6). This is a vast simplification, but might get you started toward
understanding it.

BTW, I'm posting as opposed to Emailing as I think a fair number of people
are confused by the same issues, and if so a discussion will ensue.

Dave Seward
uunet!actnyc!djs

  reply	other threads:[~1988-06-10 23:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-06-08 11:55 Alsys compiler bugs??? Charles Williams
1988-06-10 23:24 ` Dave Seward [this message]
  -- strict thread matches above, loose matches on Subject: below --
1988-06-09 14:10 Norman Cohen
replies disabled

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