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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7a2d45f282a1da1c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-29 22:01:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: float with 24-bit resolution Date: Sat, 30 Aug 2003 00:02:56 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3F3CCB0F.543478AF@adrianhoe.nospam.com.my> <3f405ef4$1_1@news.tm.net.my> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:41965 Date: 2003-08-30T00:02:56-05:00 List-Id: "Matthew Heaney" wrote in message news:bj40b.59$yQ3.11@newsread1.news.atl.earthlink.net... > > "Adrian Hoe" wrote in message > news:3f405ef4$1_1@news.tm.net.my... > > > > But subtracting the value of Angle_Delta makes the code more > > understandable, doesn't it? That translates to -360.0000000 .. > +359.9999571. > > No, it does not. The practice of subtracting off T'Small from the upper > bound in the type declaration is distracting, and only adds unecesssary > noise. The language is the way it is, so don't fight it. Bull. :-) The phony declaration of the upper bound is confusing to the reader; users should not take advantage of this "convinience". Consider: Limit : constant := 360.0; The_Small : constant := Limit / 2.0**23; type Matts_Type is delta The_Small range -Limit .. Limit; Obj : Matts_Type; if Matts_Type'Last /= Limit then Put_Line ("Yep, the specified limit wasn't used"); end if; Obj := Limit; -- Raises Constraint_Error! The last is likely to be mysterious during maintenance, even to be knowledgable user. type Randys_Type is delta The_Small range -Limit+The_Small .. Limit-The_Small; does not suffer from that confusion, and is hardly any harder to read. (Note that this "convinence" applies to both bounds of the fixed point type, and fixed point types don't get the most negative value that integer types do.) Randy.