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-17 04:41:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: float with 24-bit resolution Date: 17 Aug 2003 12:40:14 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <3F3CCB0F.543478AF@adrianhoe.nospam.com.my> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1061120505 15253 62.49.19.209 (17 Aug 2003 11:41:45 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 17 Aug 2003 11:41:45 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:41629 Date: 2003-08-17T12:40:14+01:00 List-Id: "Matthew Heaney" writes: > "Simon Wright" wrote in message > news:x7vy8xuu235.fsf@smaug.pushface.org... > > "Jeffrey Creem" writes: > > > > You need to use the compiler's inbuilt infinite precision arithmetic here: > > > > package Angles is > > > > Angle_Delta : constant := 360.0 / 2 ** 23; > > > > type Angle is delta Angle_Delta range -360.0 .. 360.0 - Angle_Delta; > > for Angle'Small use Angle_Delta; > > for Angle'Size use 24; > > > > end Angles; > > This is correct, except that you don't need to subtract the value of > Angle_Delta when specifying the Angle'Last. The following declaration is > perfectly correct: > > Angle_Delta : constant := 360.0 / 2 ** 23; > type Angle is delta Angle_Delta range -360.0 .. 360.0; --360, not > 360-T'Small > for Angle'Small use Angle_Delta; > for Angle'Size use 24; I suppose this is some sort of convenience offered by the compiler? or is it the ARM? or an AI? because clearly there is no binary representation of +360.0.