comp.lang.ada
 help / color / mirror / Atom feed
From: "AG" <a_n_g@x_t_r_a.c_o.n_z>
Subject: Re: type declaration and storage requirements
Date: Mon, 3 Jun 2002 19:57:24 +1200
Date: 2002-06-03T19:57:24+12:00	[thread overview]
Message-ID: <viFK8.309$Er4.45132@news.xtra.co.nz> (raw)
In-Reply-To: bebbba07.0206022258.5653ecac@posting.google.com


"Russ" <18k11tm001@sneakemail.com> wrote in message
news:bebbba07.0206022258.5653ecac@posting.google.com...
> "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?"

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]







  reply	other threads:[~2002-06-03  7:57 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 [this message]
2002-06-03 11:19     ` martin.m.dowie
2002-06-03 12:40     ` Larry Kilgallen
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