comp.lang.ada
 help / color / mirror / Atom feed
From: Kilgallen@SpamCop.net (Larry Kilgallen)
Subject: Re: type declaration and storage requirements
Date: 3 Jun 2002 06:40:28 -0600
Date: 2002-06-03T06:40:28-06:00	[thread overview]
Message-ID: <qS3o8GNXO8xU@eisner.encompasserve.org> (raw)
In-Reply-To: bebbba07.0206022258.5653ecac@posting.google.com

In article <bebbba07.0206022258.5653ecac@posting.google.com>, 18k11tm001@sneakemail.com (Russ) writes:
> "martin.m.dowie" <martin.m.dowie@ntlworld.com> wrote in message news:<hfyK8.40339$wd3.6272305@news6-win.server.ntlworld.com>...
>> "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.



  parent reply	other threads:[~2002-06-03 12:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-02 21:21 type declaration and storage requirements Russ
2002-06-02 23:54 ` martin.m.dowie
2002-06-03  0:40   ` Dale Stanbrough
2002-06-03 11:10     ` martin.m.dowie
2002-06-04  2:40       ` Dale Stanbrough
2002-06-03  6:58   ` Russ
2002-06-03  7:57     ` AG
2002-06-03 11:19     ` martin.m.dowie
2002-06-03 12:40     ` Larry Kilgallen [this message]
2002-06-03 13:12     ` Gautier
2002-06-03  2:26 ` Jeffrey Carter
2002-06-04 10:35 ` Simon Wright
2002-06-04 13:04   ` Martin Dowie
2002-06-06  8:06     ` Simon Wright
2002-06-11  7:18 ` David Thompson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox