在程序中执行如下这句话,只会输出0.000000
UART_PRINT("\n\nVoltage is %f\n\n",(((float)((***[4+index] >> 2 ) & 0x0FFF))*1.4)/4096);
但是单独输出(***[4+index] >> 2) & 0x0FFF的话,结果就是对的。
后来测试:
int i = 5;
UART_PRINT("i is %f\n", i);
也输出错误,输出0.000000
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.
在程序中执行如下这句话,只会输出0.000000
UART_PRINT("\n\nVoltage is %f\n\n",(((float)((***[4+index] >> 2 ) & 0x0FFF))*1.4)/4096);
但是单独输出(***[4+index] >> 2) & 0x0FFF的话,结果就是对的。
后来测试:
int i = 5;
UART_PRINT("i is %f\n", i);
也输出错误,输出0.000000