comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <eachus@mitre.org>
Subject: Fixed Point Numbers
Date: 1999/05/27
Date: 1999-05-27T00:00:00+00:00	[thread overview]
Message-ID: <374DBCE1.9FB720E6@mitre.org> (raw)

Philip Bradley wrote:
  
> The first definition is the desired definition (and compiles using
> Gnat).  Unfortunately the 2nd one is as close as I can get using a
> different compiler - one I am having to use, but not by choice!

    You should be pleased that both compilers will allow you to get what
you want, and my hat is off to GNAT for supporting the first definition.
 
> I am really only interested in the effect on the attributes, operators
> etc. of Long_type if the 2nd definition is used rather than 1st.  Does
> anyone know?
 
    In both cases you should get exactly the same representation, and
operations that use hardware overflow to do range checking, although you
may (or may not) get different values for 'Last.  The definition of
fixed point types cleverly does not require that the end points of the
specified range be values of the (sub)type.  This allows the compiler in
both cases to exclude the value +180.0 from the representable values for
the type and fit it exactly in 32-bits.  (By the rules you can also
exclude -180.0, but I would expect this only on ones-complement
machines.)
-- 

                                        Robert I. Eachus

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




             reply	other threads:[~1999-05-27  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-27  0:00 Robert I. Eachus [this message]
1999-06-08  0:00 ` Fixed Point Numbers Robert A Duff
1999-06-09  0:00   ` Robert I. Eachus
  -- 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