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/MSP430FR6043:浮动值

Guru**** 2539500 points


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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/860759/ccs-msp430fr6043-floating-value

器件型号:MSP430FR6043

工具/软件:Code Composer Studio

你(们)好

我想对浮点变量执行一些运算、

但是、一旦我为 float 变量分配了一个浮点值、我在执行时会更改其值

请参阅以下屏幕截图

为什么会发生这种情况,我 使用的是 CCS 9.1.0版本  

此致、

Sumit  

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

    您好、Sumit、

    我将对此进行深入研究、并将很快返回给您。

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

    浮点数在16位机器上没有9位精度。

    查看 float.h、尤其是 FLT_DIG。 在 Harbison 和 Steele 的示例中、它显示了6。

    我刚刚检查了我的 MSP432项目、并立即感到困惑。

    它显示了一个6的 FLT_DIG 和一个9的 FLT_DECIMAL_DIG、这两个都带有"十进制精度"注释。