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-16 08:35:22 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada References: <3F3CCB0F.543478AF@adrianhoe.nospam.com.my> Subject: Re: float with 24-bit resolution X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: Date: Sat, 16 Aug 2003 15:35:21 GMT NNTP-Posting-Host: 65.110.133.134 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1061048121 65.110.133.134 (Sat, 16 Aug 2003 08:35:21 PDT) NNTP-Posting-Date: Sat, 16 Aug 2003 08:35:21 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:41588 Date: 2003-08-16T15:35:21+00:00 List-Id: "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;