acosf 是 cosf 的反函数,但它 从[-1、1]返回的值是错误的结果,给定0.5返回值是0.5,该值应该是(pi/3),这是错误的

当我使用 atan2f 或 cosf 函数时、返回值是正确的
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
acosf 是 cosf 的反函数,但它 从[-1、1]返回的值是错误的结果,给定0.5返回值是0.5,该值应该是(pi/3),这是错误的

当我使用 atan2f 或 cosf 函数时、返回值是正确的
啊! 我想发生这种情况的原因是您使用的是 F28335、该器件没有 TMU、而 FPUFastRTS 库 acos 函数会假定存在 TMU (除 FPU 之外)。 请查看 acos_F32.asm 和 TMU 指令。
一些 FPUFastRTS 库函数是这样的。 其他一些功能是 TMU 替代功能、即它们是在没有 TMU 指令的情况下实现的、旨在模仿 TMU 中以简单指令形式提供的功能。
奇怪的是、您的项目生成并未带来错误。 我认为、基本上您的项目设置可能已启用 TMU0、因此正在构建、但当您在没有 TMU 的 F2833x 器件上运行它时、它只是无声失败(未丢弃错误)。
谢谢。
SIRA