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++
基础教程推荐
- 将不可复制的闭包对象传递给 std::function 参数 2021-01-01
- C++:获取传递给函数的多维数组的行大小 2021-01-01
- 如何更改 SysDateTimePick32 或 CDateTimeCtrl 的背景颜色? 2022-01-01
- 与 CAS 的原子交换(使用 gcc 同步内置函数) 2022-01-01
- c++ STL设置差异 2022-01-01
- 提升 ASIO 流缓冲 2021-01-01
- 如何在 C++ 中正确使用命名空间? 2022-01-01
- 为什么我们不能使用“虚拟继承"?在 COM 中? 2022-01-01
- 随机插入/删除的综合向量与链表基准 2022-01-01
- 如何部分禁用 cmake C/C++ 自定义编译器检查 2021-01-01
