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,cc4f25d878383cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-11 19:29:44 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!ppp-1-15.cvx2.telinco.NET!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: Dimensionality Checking (Ada 20XX) Date: Wed, 12 Dec 2001 01:59:53 -0000 Message-ID: <9v6iv5$dcrbf$1@ID-25716.news.dfncis.de> References: <11bf7180.0112070815.2625851b@posting.google.com> <9v0crt$bo2bi$1@ID-25716.news.dfncis.de> <9v37rs$cdmva$1@ID-25716.news.dfncis.de> <9v5loh$d5aki$1@ID-25716.news.dfncis.de> <3C168DB0.C139DC2@Raytheon.com> NNTP-Posting-Host: ppp-1-15.cvx2.telinco.net (212.1.140.15) X-Trace: fu-berlin.de 1008127782 14052719 212.1.140.15 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: archiver1.google.com comp.lang.ada:17809 Date: 2001-12-12T01:59:53+00:00 List-Id: "Mark Johnson" wrote in message news:3C168DB0.C139DC2@Raytheon.com... > > But nothing prevents a compiler from implementing fixed point > > operations/representations using the hardware's floating point unit/format. > > (Am I wrong?) > Its been a while since I've done fixed point arithmetic, but I believe > you are wrong. > ... > You can't represent a Bam in a 32 bit floating point - not enough > precision. Of course, our orbital models are now done in 64 bit floating > point, so the original comment is certainly accurate on a lot of systems > these days. That's actually exactly what I meant. > I would tend to use fixed point for the following cases... > - interfaces to hardware > - small target systems > - where I need absolute control of error > and floating point everywhere else. With respect, Mark (and in deference to the practicalities of actual Ada implementations), perhaps you shouldn't. Or at least, perhaps in many of those cases where you use floating point (because fixed point offers no great advantage), you would use a fixed point (unit-specific) type so as to gain the advantage of dimension checking (or unit conversion). Would it actually be problem to do this? -- Best wishes, Nick Roberts