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.

关于变量为负数时,程序判断为负数大于正数!!!,为什么,怎么让负数小于正数!



比如我用AD采样电压值,一个光电池电压PV,一个蓄电池电压BAT,计算出来PV的值为负电压,BAT的电压为正值,

如果PV值为-5V,BAT电压为12V,为什么if(PV>BAT)这句函数居然成立,用if(PV>0)这句函数就不成立,为什么!!!