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.

[参考译文] CCS/TMS320F28377S:如何避免在 CCS 中被零除。

Guru**** 2454880 points
Other Parts Discussed in Thread: TMS320F28377S

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/843936/ccs-tms320f28377s-how-to-avoid-division-by-zero-in-ccs

器件型号:TMS320F28377S

工具/软件:Code Composer Studio

您好!

我正在使用 TMS320F28377S DSP 进行实验。 控制算法要求用一个变量将误差输入分频至控制器。 我想知道如何避免被零除。 如果避免进行除法、则效果良好。  

谢谢。

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

    除法前必须检查除数:

    如果(底部==0)

     //除以零恢复!

    div =顶部/底部;