comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <eachus@mitre.org>
Subject: Re: Fixed Point Numbers
Date: 1999/06/09
Date: 1999-06-09T00:00:00+00:00	[thread overview]
Message-ID: <375EBE60.5C3A61DD@mitre.org> (raw)
In-Reply-To: wcc909uhbdb.fsf@world.std.com



Robert A Duff wrote:
  
> You misspelled "confusingly".  ;-)

   No, I meant cleverly:

  "An ordinary_fixed_point_definition defines an ordinary fixed point
type whose base range includes at least all multples of small that are
between the bounds specified in the real_range_specification. The base
range of the type does not necessarily include the specified bounds
themselves.  An ordinary_fixed_point_definition also defines a
constrained subtype of the type, with each bound of its range given by
the closer to zero of:

  "    the value of the conversion to the fixed point type of the
corresponding expression of the real_range_specification;

  "    the corresponding bound of the base range." RM 3.5.9 (13-15)

    In Ada 83 the wording was very confusing and led to more than one AI
(AI-143, AI-144, and AI-340):

  "For a fixed point constraint that includes a range constraint, the
model numbers include zero and all multiples of small whose mantissa can
be expressed using exactly B binary digits, where the value of B is
chosen as the smallest integer number for which each bound of the
specified range is either a model number or lies at most small distant
from a model number..." RM83 3.5.9(6)

> After all, I don't expect this:

>    type T is range -2**31..2**31;

> to fit in 32 bits!

   Good, because in Ada 95, it may fit, but it need not.  For example on
36-bit, 48-bit, or 64-bit machines, I would expect objects of this type
by default to fit in one word and have 2**32 + 1 possible values for the
subtype.

-- 

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




  reply	other threads:[~1999-06-09  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-27  0:00 Fixed Point Numbers Robert I. Eachus
1999-06-08  0:00 ` Robert A Duff
1999-06-09  0:00   ` Robert I. Eachus [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-05-27  0:00 Philip Bradley
1999-05-28  0:00 ` Robert Dewar
replies disabled

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