我只想在我的微控制器程序中计算:
uint16_t aOffset = 0;
uint16_t bOffset = 0;
uint16_t a = 530;
uint16_t b = 530;
int16_t aReal = a - aOffset;
int16_t bReal = b - bOffset;
int32_t c = (int32_t) aReal * bReal;
printf("%d, %d, %d\n", aReal, bReal, c);
输出是:
530,530,18756
但输出应该是:
530,530,280900
这里有什么问题?