comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Large numbers (or is Ada the choice for me?)
Date: Fri, 09 Mar 2001 16:59:32 -0500
Date: 2001-03-09T21:59:33+00:00	[thread overview]
Message-ID: <3AA95244.94BAD60D@averstar.com> (raw)
In-Reply-To: slrn9ai9uk.iv9.georg@apal.ii.uib.no

Hans Georg Schaathun wrote:
> 
> I need a tool to solve large systems of linear equations, with no
> floating point operations (or any other approximations) allowed.
> Even though I am not a seasoned programmer, I think I'll have to
> write the tool myself.
> 
> My question is, will it be reasonably simple to handle large
> rational numbers with Ada?  Is there any packages for this?
> 
> Does basic Ada (gnat) support (f.ex.) 2048-bit integers?  Does
> any module exist for integers of dynamic size?  Are these
> handled reasonably efficiently, or is there much overhead?

The source for the GNAT compiler includes the source for
their "universal arithmetic" package I presume, which (again,
presumably) does arbitrary precision integer and rational 
arithmetic.

> 
> I guess I will manage to implement the rational numbers without
> too much hardship, but I really don't feel like implementing
> arithmetics on large integers.

Try the GNAT compiler sources.  We also have one lying around somewhere.

My friends in "experimental mathematics" (sounds like fun, eh?) generally
prefer to use arbitrary-precision packages based on the Chinese
remainder theorem, because that allows large multiplications to
be performed very efficiently.  Essentially a number is represented
by its value modulo a series of prime numbers, typically those just
less than 2**31.  Multiplication can then be done by 
multiplying the individual "digits" independently.  A few dozen "digits"
is usually enough to handle some very large numbers. 
 
> 
> :-- Hans Georg
> --
> Signature en panne.

-- 
-Tucker Taft   stt@avercom.net   http://www.averstar.com/~stt/
Chief Technology Officer, AverCom Corporation (A Titan Company) 
Burlington, MA  USA (AverCom was formerly the Commercial Division of AverStar:
http://www.averstar.com/services/ebusiness_applications.html)



  parent reply	other threads:[~2001-03-09 21:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-09 18:58 Large numbers (or is Ada the choice for me?) Hans Georg Schaathun
2001-03-09 19:35 ` Marin David Condic
2001-03-09 20:44   ` David Starner
2001-03-09 23:12     ` Marin David Condic
2001-03-10  2:56       ` David Starner
2001-03-10 11:37         ` Florian Weimer
2001-03-10  6:08       ` tmoran
2001-03-09 21:01   ` Randy Brukardt
2001-03-09 23:02   ` Robert A Duff
2001-03-09 23:28     ` Marin David Condic
2001-03-10 16:49       ` Hans Georg Schaathun
2001-03-10 11:59   ` Jeffrey Carter
2001-03-09 20:37 ` Brian Catlin
2001-03-09 21:26 ` JP Thornley
2001-03-09 21:59 ` Tucker Taft [this message]
2001-03-15  8:33   ` Modular type (Re: Large numbers) Hans Georg Schaathun
2001-03-15 10:58     ` Florian Weimer
2001-03-15 11:12       ` Hans Georg Schaathun
2001-03-15 16:24         ` Tucker Taft
2001-03-10  1:42 ` Large numbers (or is Ada the choice for me?) Keith Thompson
2001-03-19 20:48 ` Robert I. Eachus
2001-03-20  3:33   ` Brian Rogoff
replies disabled

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