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-09-02 09:02:49 PST Date: Wed, 03 Sep 2003 00:05:27 +0800 From: Adrian Hoe User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5b) Gecko/20030727 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: float with 24-bit resolution References: <3F3CCB0F.543478AF@adrianhoe.nospam.com.my> <3f405ef4$1_1@news.tm.net.my> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 219.95.191.231 X-Original-NNTP-Posting-Host: 219.95.191.231 Message-ID: <3f54bf19_1@news.tm.net.my> X-Trace: news.tm.net.my 1062518553 219.95.191.231 (3 Sep 2003 00:02:33 +0800) Organization: TMnet Malaysia Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.telusplanet.net!newsfeed.telus.net!news3.optonline.net!ash.uu.net!news1.tm.net.my Xref: archiver1.google.com comp.lang.ada:42066 Date: 2003-09-03T00:05:27+08:00 List-Id: Randy Brukardt wrote: > "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; "-Limit+The_Small .. Limit-The_Small" does not comply to my requirement which the angle must be in -360.0000000 to +359.9999571. > 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. > > > > >