comp.lang.ada
 help / color / mirror / Atom feed
From: kanderso@kleber.ICS.UCI.EDU (Ken Anderson)
Subject: Re: Large Integers?
Date: 10 Jan 95 19:47:34 GMT
Date: 1995-01-10T19:47:34+00:00	[thread overview]
Message-ID: <9501101146.aa15982@paris.ics.uci.edu> (raw)
In-Reply-To: SPIEGEL.95Jan10115602@berlin.bruessel.informatik.uni-stuttgart.de

In comp.lang.ada you write:

>I am writing a network monitor program in Ada. Since, among other
>things, it counts the number of bytes flowing through the cable, I'll
>sooner or later run into integer overflows (the number might well
>exceed 2**31-1, which is the upper limit of Natural).

>Thus, I'm looking for a package that implements large positive
>integers. Range 0 .. 2**32-1 ("unsigned word") would not be enough, I'd
>rather need at least range 0 .. 2**40. An "unsigned double word"
>(0 .. 2**64-1) would save me from overflows for a few thousand
>years.

I believe

type Large_Natural is range 0 .. 2**64-1;

should do the trick if your compiler is smart enough and your machine
can handle it.

The syntax might be wrong (I don't have the ALRM handy) but I think
that gives you the idea...

Ken
--
--------------------------------------------------------------------------------
-Ken Anderson            Ken_Anderson@acm.org                       U.C. Irvine-
- "A knowledge of C is probably better than nothing." -- J.G.P. Barnes         -
--------------------------------------------------------------------------------



  reply	other threads:[~1995-01-10 19:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-01-10 10:56 Large Integers? Andre Spiegel
1995-01-10 19:47 ` Ken Anderson [this message]
1995-01-10 20:45 ` Charles H. Sampson
1995-01-11  2:39   ` Robert Dewar
     [not found] ` <EACHUS.95Jan11095036@spectre.mitre.org>
1995-01-13 15:56   ` Andre Spiegel
     [not found] ` <SPIEGEL.95Jan11111040@berlin.bruessel.informatik.uni-stuttgart.de>
     [not found]   ` <3fhjr1$4h8@rational.rational.com>
1995-01-18 23:22     ` 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