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++ 定点库?


基础教程推荐
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 这个宏可以转换成函数吗? 2022-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07