comp.lang.ada
 help / color / mirror / Atom feed
From: "REH" <spamjunk@stny.rr.com>
Subject: Re: Ada decimal types
Date: 10 May 2006 14:26:03 -0700
Date: 2006-05-10T14:26:03-07:00	[thread overview]
Message-ID: <1147296363.925446.64230@i39g2000cwa.googlegroups.com> (raw)
In-Reply-To: <DNidnf2L39vQzP_ZRVn-rg@megapath.net>


Randy Brukardt wrote:
> "REH" <spamjunk@stny.rr.com> wrote in message
> news:1147263720.249883.220580@j73g2000cwa.googlegroups.com...
> ...
> > OK, my assumption was that when they added decimal fixed points to the
> > language, you declared them via "digits x" otherwise you would get a
> > binary fixed point.  Is that not true?
>
> There is no such thing as "binary fixed point"! There is "ordinary fixed
> point" and "decimal fixed point". For all fixed point types, the "small" is
> the smallest value that can be exactly represented. Other values are
> multiples of the small. (The only effect of the delta is to provide guidance
> for the *default* selection of the small value; the only thing that matters
> is the small value). For "ordinary fixed point", the small value can be
> anything. The *default* is a power of two, but it can be specified as any
> value (including powers of ten). For "decimal fixed point", the *default*
> small value is a power of ten.
>
> The representation of the multiples of small can be anything that the
> compiler wants to use (and this may, but doesn't have to vary between
> ordinary and decimal fixed point types). Typically, the representation is
> some binary integer representation.
>
> It is possible for a compiler to reject specifying a small of 1.0e-6. That
> would be a pretty lame Ada 95 compiler, IMHO, given that it has to be
> supported in decimal types. Ada 83 compilers used to reject these because
> there were impossible precision requirements for mixed multiplies (these
> were changed in Ada 95), so there may be some Ada myths about avoiding the
> specification of small values.
>
> I think that *all* ordinary fixed point types should have 'Small specified,
> because then there is no surprise or guesswork as to what precision is being
> used.
>
> I was going to suggest that you read some online resources, but I wasn't
> able to find any that explain this correctly (other than the RM, and I
> wouldn't suggest starting there!). Specifically, the wikibook entry is
> over-simplified to the point of being wrong. I hope someone has the time to
> correct it on the lines I give above.
>
>                                       Randy.

Thank you.  I appreciate you taking the time to explain that.  Yes, I
was confused.  I am coming from an Ada '83 background, and our compiler
didn't like base-10 smalls (thus my misunderstanding).  I have been
looking for some information online, without much luck.  The standard
is not very clear (to me), and none of my Ada books some to go indepth
on the subject.

REH




  reply	other threads:[~2006-05-10 21:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-04 15:23 Ada decimal types REH
2006-05-04 18:17 ` Jeffrey R. Carter
2006-05-04 22:20   ` REH
2006-05-05  9:14 ` Stephen Leake
2006-05-05 11:33   ` REH
2006-05-05 16:49     ` tmoran
2006-05-05 18:08       ` REH
2006-05-05 18:49         ` tmoran
2006-05-05 18:59           ` REH
2006-05-06  8:59         ` Keith Thompson
2006-05-06 14:01           ` REH
2006-05-06 15:48             ` Simon Wright
2006-05-06 16:39               ` REH
2006-05-08 21:19                 ` Randy Brukardt
2006-05-09 23:21                   ` REH
2006-05-10  1:08                     ` Keith Thompson
2006-05-10  5:37                     ` Simon Wright
2006-05-10 12:22                       ` REH
2006-05-10 20:47                         ` Randy Brukardt
2006-05-10 21:26                           ` REH [this message]
2006-05-10 20:52                       ` Randy Brukardt
2006-05-11  5:51                         ` Simon Wright
2006-05-11 22:33                           ` Randy Brukardt
2006-05-05 20:32     ` Randy Brukardt
replies disabled

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