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.
Generally, In low-level languages like C, the precision of integers is limited to 64-bit, but Python implements Arbitrary-precision integers.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With