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.

[参考译文] TMS320F2800157:有关使用 sinf 和 cosf 的问题

Guru**** 2540720 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1298711/tms320f2800157-issue-about-using-sinf-and-cosf

器件型号:TMS320F2800157

大家好、

以下是有关 正弦波 余弦  需要您的帮助:

1.有些结果是正确的,有些结果是错误的。 原因是什么?

#define CONST_PI_32     3.14159265358979323846f
float32_t tmp;
tmp = (float32_t)sinf(CONST_PI_32/4);                 // 0.707106769,correct
tmp = (float32_t)sinf(CONST_PI_32/4 + CONST_PI_32/5); // 0.987298429
tmp = (float32_t)sinf(CONST_PI_32/4 + CONST_PI_32/4); // 1.0, correct
tmp = (float32_t)sinf(CONST_PI_32/4 + CONST_PI_32/3); // 0.0, incorrect
tmp = (float32_t)cosf(CONST_PI_32/4);                 // 0.0, incorrect
tmp = (float32_t)cosf(CONST_PI_32/4 + CONST_PI_32/5); // -0.00242325524, correct or not?
tmp = (float32_t)cosf(CONST_PI_32/4 + CONST_PI_32/4); // 0.0, correct
tmp = (float32_t)cosf(CONST_PI_32/4 + CONST_PI_32/3); // 0.0, incorrect

2. sinf 和 cosf 的参数范围是否 从 (-Pi) 到(Pi)?

--

谢谢、此致

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我们有关这一主题的专家目前不在办公室,预计将在12月4日前回来。 请预计响应会延迟。

    此致、

    瓦尔沙

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    请告诉我:

    • 您的编译器构建选项是什么
    • 即、您是否正在使用 TMU?
    •  编译器是否发出过任何编译警告?

    此致

    洛里