Extended Precision Floating Point Library C/C++(扩展精度浮点库 C/C++)
问题描述
我正在寻找具有以下功能的扩展精度浮点库:
I am looking for an extended precision floating point library with the following features:
- 固定数据类型大小(即扩展精度浮点数占用固定内存量)
- 变量无需初始化
- 指定尾数和指数的大小
- C/C++ 接口
- 支持非常大的浮点数 > 10^10000
我能找到的最接近的是 Ivano Primi 的 HPA 库.这个库的唯一问题是我无法扩展指数(它用 15 位固定).它允许我对尾数进行多种选择,但最大的可表示数字始终限于 10^4932.GMP 等其他库需要初始化,并且不允许固定大小的数据类型.关键是我不需要任意精度,而只是扩展.但我需要有非常大的指数.
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.
感谢您的帮助!
标记
推荐答案
看来ttmath很接近我在寻找什么.它允许使用指数和尾数值指定大浮点数,并且不需要初始化.
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.
这篇关于扩展精度浮点库 C/C++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:扩展精度浮点库 C/C++
基础教程推荐
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- CString 到 char* 2021-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
