Is there an arbitrary precision floating point library for C/C++ which allows arbitrary precision exponents?
Asked Answered
P

3

12

I'm looking for an arbitrary precision floating point library for C/C++ (plain C is preferred). I need arbitrary precision exponents. GMP and MPFR use fixed size exponents, so they are ineligible (I have some ideas for workarounds, but I prefer an out-of-the-box solution). It would be an nice feature if the exponent precision can be adjusted automatically to prevent infinity-values.

If you know for sure that such an library does not exist, please say so.

Pizza answered 13/10, 2012 at 18:49 Comment(0)
S
6

There is nothing as mainstream as GMP/MPFR as far as I know. But Fredrik Johansson's arb contains a module called fmpr that provides floating-point numbers with arbitrary precision exponents.

Salaam answered 14/10, 2012 at 17:19 Comment(0)
E
1

That's a pretty specialized request; without knowing more about your actual needs, I might consider using a more common arbitrary-precision library like MPFR to represent the logarithms of your values (which doesn't quite give truly arbitrary exponent range, but does get you exponents so large that it's probably no longer an issue).

Edgy answered 6/11, 2012 at 17:56 Comment(0)
E
0

You might take a look at http://www.ttmath.org/ - I don't think it can adjust precision on-the-fly, but it does support arbitrary precision reasonably well.

Eigenvalue answered 6/11, 2012 at 16:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.