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/MSP430G2253:如何在 MSP430G2253中执行日志和反日志功能

Guru**** 2502205 points
Other Parts Discussed in Thread: MSP430G2253

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/850393/ccs-msp430g2253-how-to-do-log-and-anti-log-functions-in-msp430g2253

器件型号:MSP430G2253

工具/软件:Code Composer Studio

大家好、

我正在我的项目中使用 MSP430G2253控制器、现在我想执行 日志和反日志 函数。是否可以使用日志和反日志数学库。

如果可能、如何在 代码中实现?

我按如下所示尝试,但编译器显示错误#29,需要一个表达式

i=log (double (j);

谢谢

Raja.D

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

    >i=log (double (j);

    此语句缺少括号。 这就是编译器所抱怨的。 它应该是:

    >i=log ((double) j);

    据我所知,log()函数(和 exp())位于 C 数学库中。 (请确保"#include" ")但是、它适用于浮点、我不确定所需的浮点支持是否适用于您的 MCU 中的2KB 闪存。 使用 IQMathlib 和定点算术等可以做得更好。

    [编辑:固定的措辞。]