TI E2E™ 设计支持论坛将于 5 月 30 日至 6 月 1 日进行维护。如果您在此期间需要技术支持,请联系 TI 的客户支持中心寻求帮助。

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.

TMS320F28069: TI 28069 编译 问题

Part Number: TMS320F28069

我目前使用TI 15.12.3.LTS 版本进行编译, 但遇到一个问题,觉得很危险,就是我使用Int16 定义了一个变量,比如Int16 current = 495;

然后定义float result = current * current, 

495*495 = 245025, 也就是0x3 BD21,但由于current 只有16 bit,编译器默认 current * current 的结果也只是使用16 bit 进行存储,于是变成0xBD21, 也就是 -17119 赋值给float 类型 的变量result ,显然这不是我所期望;

这里有什么选项可以设置,避免这一类问题吗? 或是升级编译器能解决这个问题吗?