例如
int x;
float y;
y = 9.99;
x = y;
现阶段情况,最终x等于9。希望转换时能四舍五入,结果x等于10。
通过查询用户手册,编译成汇编语言F32TOUI16,为截断效果,结果为9。
翻译成F32TOUI16R,为四舍五入效果,结果为10。
如何能让编译器翻译成F32TOUI16R,求解答。
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.
例如
int x;
float y;
y = 9.99;
x = y;
现阶段情况,最终x等于9。希望转换时能四舍五入,结果x等于10。
通过查询用户手册,编译成汇编语言F32TOUI16,为截断效果,结果为9。
翻译成F32TOUI16R,为四舍五入效果,结果为10。
如何能让编译器翻译成F32TOUI16R,求解答。