C++ fixed point library?(C++ 定点库?)
问题描述
我正在寻找一个免费的 C++ 定点库(主要用于嵌入式设备,而不是用于任意精度的数学).基本上,要求是:
I am looking for a free C++ fixed point library (Mainly for use with embedded devices, not for arbitrary precision math). Basically, the requirements are:
- 没有不必要的运行时开销:任何可以在编译时完成的工作,都应该在编译时完成.
- 能够在定点和浮点之间透明地切换代码,没有固有的开销.
- 定点数学函数.如果您需要来回转换以求平方根,那么使用不动点就没有多大意义了.
- 占地面积小.
有什么建议吗?
推荐答案
有一个开源定点数学库项目,可以通过以下链接找到:
There is an open-source fixed point math library project which can be found by following the links below:
- libfixmath 项目页面
- libfixmath 维基百科文章
它是一个 C 静态库,为 C++ 用户提供 C++ 类接口,它实现了以下功能:触发.函数:sin、cos、tan、asin、acos、atan、atan2饱和算术:sadd、ssub、smul、sdiv其他函数:sqrt、exp
It is a C static library with a C++ class interface for C++ users, it implements the following functionality: Trig. Functions: sin, cos, tan, asin, acos, atan, atan2 Saturated Arithmetic: sadd, ssub, smul, sdiv Other Functions: sqrt, exp
它仅支持 16.16 定点数据类型.
这是一个积极开发的开源项目(寻找感兴趣的开发人员).
It is an actively developed open-source project (looking for interested developers).
这篇关于C++ 定点库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C++ 定点库?
基础教程推荐
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- CString 到 char* 2021-01-01
