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 04:43:08 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!feed.newsfeeds.com!newsfeed.onecall.net!chcgil2-snf1.gtei.net!news.gtei.net!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: type declaration and storage requirements Date: 3 Jun 2002 06:40:28 -0600 Organization: LJK Software Message-ID: References: NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1023104434 25611 192.135.80.34 (3 Jun 2002 11:40:34 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Mon, 3 Jun 2002 11:40:34 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:25251 Date: 2002-06-03T06:40:28-06:00 List-Id: In article , 18k11tm001@sneakemail.com (Russ) writes: > "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?" > > 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? I haven't followed the entire discussion, but I presume this is for use in portable programming where one cannot just look at the machine and compiler documentation. If you specified single or double precision, what would you do on VAX, where you have a choice of three precisions ? Do you always mean "smallest" and "largest" when you say single and double ? What would you say to get the other one - "middle" ? If that is the case, what happens when you move that program from VAX to some other system where there are only two choices ? What would happen to those where you specified "middle" is that a "middle if you have it but otherwise smallest" or would you prefer "middle if you have it but otherwise largest"? Of course dedicated VAX fans remember that there are two different 64-bit floating point types, D and G. The different between them is their mantissa and exponent, math thingies that have to do with range and precision supported by the hardware. Now we could all specify floating point types in terms of the VAX precisions, F, G, D and H, but that raised complications when Alpha came along with S and T floating point types, so on Alpha VMS supports 5 types (I forget which one they dropped). So even specifying you want 32 bit or 64 bit floating point types does not nail it down.