Mail Archives: djgpp/1997/08/12/08:53:00
Dan Goodman wrote:
> Does anyone have, or know of, a C++ class and functions that can do
> arbitrary precision arithmetic (both in very large numbers and very
> accurate numbers)? Please e-mail the source code if you have any...
Funny you should say that...
I'm working on a class wrapper for the GNU MultiPrecision library,
which is a C library available from all GNU archives (look for
gmp-x.y.z.tar.gz - at present x.y.z is 2.0.2 for the latest
version, available from ftp://prep.ai.mit.edu/pub/gnu). It's a
very comprehensive library, supporting arbitrary precision integer,
rational (fractions) and floating point.
My wrapper is nowhere near ready yet, but I hope to have a usable
version in the next week or so. I'll willingly distribute the
source of that, but you'll have to get gmp yourself, I'm not sending
a 360K file by mail!
Warning: it's a bit of a pig to unpack, because the directories and
files are Unix names. A PKZIP version is available by http only as
http://www.keris.demon.co.uk/bin/gmp202.zip (note that you have to
straight to the directory, there's no link from the homepages) which
can be unzipped using PKUNZIP -d. You may have to edit file make.bat
to remove the /y on the move command near the end. If you can wait
a day or so, I'll zip up my version from home which I know compiles
easily...
Chris C
- Raw text -