Extended Precision Floating Point Library C/C++

和自甴很熟 提交于 2019-12-18 12:36:34

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/10156002/extended-precision-floating-point-library-c-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!