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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4f1dddd3318e056d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-03 00:56:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!arclight.uoregon.edu!enews.sgi.com!news.xtra.co.nz!not-for-mail From: "AG" Newsgroups: comp.lang.ada References: Subject: Re: type declaration and storage requirements X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Mon, 3 Jun 2002 19:57:24 +1200 NNTP-Posting-Host: 210.86.43.22 X-Complaints-To: newsadmin@xtra.co.nz X-Trace: news.xtra.co.nz 1023090971 210.86.43.22 (Mon, 03 Jun 2002 19:56:11 NZST) NNTP-Posting-Date: Mon, 03 Jun 2002 19:56:11 NZST Organization: Xtra Xref: archiver1.google.com comp.lang.ada:25243 Date: 2002-06-03T19:57:24+12:00 List-Id: "Russ" <18k11tm001@sneakemail.com> wrote in message news:bebbba07.0206022258.5653ecac@posting.google.com... > "martin.m.dowie" wrote in message news:... > > "Russ" <18k11tm001@sneakemail.com> wrote in message > > news:bebbba07.0206021321.a3bbfac@posting.google.com... > > > Ada allows me to specify the number of digits and the range of a > > > floating-point type, or the delta and range of a fixed-point type. > > > This gives more control than, say, C/C++, which only allows me to > > > specify single or double precision. What bothers me, however, is that > > > I apparently need to do some homework of my own to determine if my > > > declaration will require one or two words for storage (for a > > > particular word size). > > [snip] > > > > I think the argument here is - "Why do you care?" If that were the case the argument would be - "why is it in the language?" Presumably, the must be a reason ... > > Why do I care about how much storage I use? Maybe I'm just obsessive, > but I would like to know if I am using single or double precision. Is > that so unreasonable? It's been some time since I had to really dig into the Ada 83 concept of model and safe numbers as defined for both float and fixed types. But I seem to recall that at least *some* changes in 95 standard in that area were exactly due to the fact that some model numbers forced a double-word implementation where a single-word would suffice. Anyone with a beter knowledge of the issue would care to comment? [I'm serious about that - would be really interesting and, perhaps, illuminating in this context] > > > The only time you care about such things are when you are defining > > interfacing Or, maybe, when you are defining a matrix about 2Gb large. Or, more likely, when you care about some obscure math properties of the numbers. > > yes, you may be the person assigned to think about such size issues - but > > that > > is not a language issue). It is the language issue exactly (or maybe it's Annex). So what do you do if you *are* the person assigned to think about such issues? Sort of need to know what the language says, right? > > I don't care what kind of "issue" you want to label it. I just want to > know whether I am using single or double precision. And what is the > point of specifying the number of digits if the compiler is just going > to choose one or two words? If I choose less than 7 digits, I probably > get single precision, but if I choose 7 (8?) or more I probably get > double precision. Well, again, I didn't need to use real numbers in Ada since 83 model but as I recall they were defined as a minimum power of two which satisfies the requirements with no regard or even a concept of a single or double precision. [And yes, there were custom-sized deltas too]