comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: 64 bit integer support as native type
Date: 23 Sep 94 11:55:41
Date: 1994-09-23T11:55:41+00:00	[thread overview]
Message-ID: <EACHUS.94Sep23115541@spectre.mitre.org> (raw)
In-Reply-To: brent@paisley.East.Sun.COM's message of 22 Sep 1994 17:29:35 GMT

In article <35setv$7nq@walters.East.Sun.COM> brent@paisley.East.Sun.COM (Brent Slone) writes:

 > Does the Ada LRM define a 64 bit integer?

    Neither the Ada 83 standard or the Ada 9X standard defines the
size of Integer, Long_Integer, Short_Integer, etc.  However the 9X
standard does provide guidance on the size and naming of various
integer types, as do the UI's for Ada 83.

 > If not, what is the most straightforward method for implementing 64
 > bit ints?

     If the compiler supports 64-bit integer types, and several do,
try:

    type Integer_64 is range -2**63..2**63-1;

    (You might want to read Robert Dewar's recent post on how to
reflect the range you actually need, but you told ME you needed
64-bits. ;-)

     If that doesn't work, and the compiler supports 32-bit integers,
there is a package in the new ADAR components which provides 64-bit
and 128-bit integer types.  This package is intended to be highly
portable.  Replacing a few low-level operations with machine code,
assembler, or calls to some other language can be used to speed things
up.  However, this package is pretty efficient right now.  If you want
to act as a beta tester, let me know.

      If you have a machine with quad-precision floating point or IEEE
Extended Precison, the Generic_Decimal package in the current ADAR
works fine.  However, it provides the equivalent of fixed-point, not
integer.  (This solution also works if you need, say, 15-digits of
precision on IEEE machines without Extended precision.)

--

					Robert I. Eachus

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



  reply	other threads:[~1994-09-23 11:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-09-22 17:29 64 bit integer support as native type Brent Slone
1994-09-23 11:55 ` Robert I. Eachus [this message]
1994-09-23 15:34 ` Robert Dewar
1994-09-23 16:09 ` Norman H. Cohen
     [not found] <35setv$7nq@walters.east.sun.com>
1994-09-23 17:41 ` Tucker Taft
replies disabled

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