From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!actnyc!djs From: djs@actnyc.UUCP (Dave Seward) Newsgroups: comp.lang.ada Subject: Re: Alsys compiler bugs??? Message-ID: <960@actnyc.UUCP> Date: 10 Jun 88 23:24:01 GMT References: <8806081155.AA02381@wooglin.scc.com> Reply-To: djs@actnyc.UUCP (Dave Seward) Organization: InterACT Corporation List-Id: 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