Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extended Precision Floating Point Library C/C++

I am looking for an extended precision floating point library with the following features:

  • fixed data type size (i.e. the extended precision float takes a fixed amount of memory)
  • no initialization required for variables
  • specify size of both mantissa and exponent
  • C/C++ interface
  • support for really large floats > 10^10000

The closest I could found is the HPA library by Ivano Primi. The only problem with this library is that I cannot extend the exponent (it is fixed with 15 bits). It allows me various choices for the mantissa, but the largest representable number is always limited to 10^4932. Other libraries like GMP require an initialization and do not allow for fixed size data types. The point is that I do not need arbitrary precision, but just extended. But I need to have very large exponents.

Thanks for your help!

Mark

like image 610
Mark Avatar asked Apr 14 '12 18:04

Mark


1 Answers

It seems that ttmath is very close to what I look for. It allows to specify big floats with exponent and mantissa value and it does not require initialization.

like image 58
Mark Avatar answered Oct 24 '22 10:10

Mark