Click to See Complete Forum and Search --> : 96, 128 bit floating point C++ library?


KevinHall
January 31st, 2003, 11:46 AM
Anyone know of an open-source 96 or 128 bit floating point C++ library? (Or even better, a specifiable but fixed bit library?)

I have seen and used apfloat, but the one thing I don't like about it is that apfloat numbers extend its precision with certain operations -- meaning that I have to continually go back an tell it I only need n significant digits.

What I'm trying to say is that I'm looking for something like:

class Float96;
class Float128;

or:

template<size_t bits>
class NBitFloat
{
//...
};

Thanks guys!

- Kevin

galathaea
January 31st, 2003, 11:59 AM
Have you tried doubledouble from the oonumerics site (http://www.oonumerics.org/oon/)? They also have EXTNUM, which changes only the exponent precision, and I believe LiDiA and some of the other packages use earlier forms of doubledouble.

KevinHall
January 31st, 2003, 12:22 PM
No, I hadn't seen it yet. It certainly looks easy to use.... I'll give it a whirl right now! Thanks!!!

-Kevin

Paul McKenzie
January 31st, 2003, 02:52 PM
You can try the 96bit library on PJ Naughter's site:

http://www.naughter.com/int96.html

Even though it says "MFC", very litte of it is MFC and won't take long to convert it or just plain rip it out.

Regards,

Paul McKenzie

KevinHall
January 31st, 2003, 03:00 PM
Thanks guys for the help. I really needed to test a routine for singular value decomposition of matrices -- there is one matrix that I'm having trouble with docomposing accurately. I wanted to make sure it was a precision thing (and that I wasn't going insane). It turns out it is!

I think that the doubledouble library is pretty simple for doing tests like this one. Thanks again!

- Kevin