P: n/a

I'm looking for a very basic highprecision arithmetic library. I
need to be able to specify a fixed number of bits or decimal digits
(32 decimal digits should be all I need). The only arithmetic
functions I need are addition, subtraction, multiplication, division,
squareroot, and comparison (i.e. lessthan, greaterthan, equal).
Preferably this should be in C++ but I could use C by putting
everything into a single class. I looked at a couple of packages but
they were massive in size, a huge overkill for my needs. I don't need
arbitrary precision, FFTbased multiplication, etc. I could write my
own package but this task seems like a common enough need that I would
be surprised if there aren't some freeware or shareware packages much
more suited to my needs. Any suggestions on an efficient small
package that handles a fixed number of digits?
If you want to respond by email, then use the following email address
(I use the volcanomail address only for reading and posting to
newsgroups and other public forums  to avoid spammers.)
rhoads "at" cs "dot" rutgers "dot" edu  
Share this Question
P: n/a

GCRhoads wrote:
I'm looking for a very basic highprecision arithmetic library. I
need to be able to specify a fixed number of bits or decimal digits
(32 decimal digits should be all I need). The only arithmetic
functions I need are addition, subtraction, multiplication, division,
squareroot, and comparison (i.e. lessthan, greaterthan, equal).
[..]
If you use a template library, your compiler will only create code
for the functions you use. Advice: try to avoid setting the limits
for yourself ahead of time, remember what happened to "640 Kbytes
should be enough for anybody"?
Take a look at CGAL, as part of it there is a numeric kernel that is
(AIUI) programmed as templates and contains part with arbitrary
precision floating points. It may be too much for your small task,
then look into OONumerics. Also, I searched for "arbitrary precision
floating point template" for you on Google and the first link that
comes up also looks promising.
Try not to crosspost to c.l.c++ AND c.l.c.
V

Please remove capital 'A's when replying by email
I do not respond to topposted replies, please don't ask  
P: n/a

GCRhoads wrote:
I'm looking for a very basic highprecision arithmetic library. I
need to be able to specify a fixed number of bits or decimal digits
(32 decimal digits should be all I need). The only arithmetic
functions I need are addition, subtraction, multiplication, division,
squareroot, and comparison (i.e. lessthan, greaterthan, equal).
Preferably this should be in C++ but I could use C by putting
everything into a single class. I looked at a couple of packages but
they were massive in size, a huge overkill for my needs. I don't need
arbitrary precision, FFTbased multiplication, etc. I could write my
own package but this task seems like a common enough need that I would
be surprised if there aren't some freeware or shareware packages much
more suited to my needs. Any suggestions on an efficient small
package that handles a fixed number of digits?
Googling "high precision arithmetic library" should yield something
useful to you.
Off the top of my head, there is GMP.

clvrmnky <mailto:sp******@clevermonkey.org>
Direct replies will be blacklisted. Replace "spamtrap" with my name to
contact me directly.  
P: n/a

GCRhoads <GC******@volcanomail.comwrites:
I'm looking for a very basic highprecision arithmetic library. I
need to be able to specify a fixed number of bits or decimal digits
(32 decimal digits should be all I need). The only arithmetic
functions I need are addition, subtraction, multiplication, division,
squareroot, and comparison (i.e. lessthan, greaterthan, equal).
Preferably this should be in C++ but I could use C by putting
everything into a single class. I looked at a couple of packages but
they were massive in size, a huge overkill for my needs. I don't need
arbitrary precision, FFTbased multiplication, etc. I could write my
own package but this task seems like a common enough need that I would
be surprised if there aren't some freeware or shareware packages much
more suited to my needs. Any suggestions on an efficient small
package that handles a fixed number of digits?
If you want to respond by email, then use the following email address
(I use the volcanomail address only for reading and posting to
newsgroups and other public forums  to avoid spammers.)
rhoads "at" cs "dot" rutgers "dot" edu
Do you know about D. H. Bailey's work? http://crd.lbl.gov/~dhbailey/
See, especially his ARBPREC package: http://crd.lbl.gov/~dhbailey/mpdist/index.html
Chip  
P: n/a

On Wed, 18 Jul 2007 19:46:15 0700, in comp.lang.c , GCRhoads
<GC******@volcanomail.comwrote:
>I'm looking for a very basic highprecision arithmetic library.
This isn't either a C or C++ question  did you try googling? Or
asking in comp.programming?

Mark McIntyre
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
Brian Kernighan  
P: n/a

Mark McIntyre <ma**********@spamcop.netwrites:
On Wed, 18 Jul 2007 19:46:15 0700, in comp.lang.c , GCRhoads
<GC******@volcanomail.comwrote:
>>I'm looking for a very basic highprecision arithmetic library.
This isn't either a C or C++ question  did you try googling? Or
asking in comp.programming?
It could be either. He is clearly looking, one can assume, for a C or
C++ library to interface too.  
P: n/a

On Jul 19, 11:26 am, Chip Coldwell <coldw...@gmail.invalidwrote:
GCRhoads <GCRho...@volcanomail.comwrites:
I'm looking for a very basic highprecision arithmetic library. I
need to be able to specify a fixed number of bits or decimal digits
(32 decimal digits should be all I need). The only arithmetic
functions I need are addition, subtraction, multiplication, division,
squareroot, and comparison (i.e. lessthan, greaterthan, equal).
Preferably this should be in C++ but I could use C by putting
everything into a single class. I looked at a couple of packages but
they were massive in size, a huge overkill for my needs. I don't need
arbitrary precision, FFTbased multiplication, etc. I could write my
own package but this task seems like a common enough need that I would
be surprised if there aren't some freeware or shareware packages much
more suited to my needs. Any suggestions on an efficient small
package that handles a fixed number of digits?
If you want to respond by email, then use the following email address
(I use the volcanomail address only for reading and posting to
newsgroups and other public forums  to avoid spammers.)
rhoads "at" cs "dot" rutgers "dot" edu
Do you know about D. H. Bailey's work?
http://crd.lbl.gov/~dhbailey/
See, especially his ARBPREC package:
http://crd.lbl.gov/~dhbailey/mpdist/index.html
Right link, wrong package.
If he wants 32 digits, then QD is the package: http://crd.lbl.gov/~dhbailey/mpdist/qd2.2.5.tar.gz
For Windows users, try this implementation: http://www.cs.berkeley.edu/~yozo/sof...2.4windll.zip
ARPREC is for gazillion digit stuff. The QD package has double double
and quad double, which sounds like it is right in the O.P.'s
wheelhouse.  
P: n/a

On Jul 19, 3:36 pm, Mark McIntyre <markmcint...@spamcop.netwrote:
On Wed, 18 Jul 2007 19:46:15 0700, in comp.lang.c , GCRhoads
<GCRho...@volcanomail.comwrote:
I'm looking for a very basic highprecision arithmetic library.
This isn't either a C or C++ question  did you try googling? Or
asking in comp.programming?
I agree that Google is the best bet.
SourceForge is always worth a look.
And if those do not pan out, then this sort of thing is suited to
news:sci.math.numanalysis   This discussion thread is closed Replies have been disabled for this discussion.   Question stats  viewed: 3367
 replies: 7
 date asked: Jul 19 '07
