谢谢大家回复,大家能不能告诉一下,下面每一步算出来的数是什么类型,值是多少。
set3的取值范围是5-99,
这一步计算出来的值
jiyiwatt*(1-set3/100.0)
#define uchar unsigned char
#define uint unsigned int
uint jiyiwatt,watt;
uchar set3=10;
if(watt < jiyiwatt*(1-set3/100.0)){ // set3是下调百分比
state = 3;
sdown = 0;
}else {
npp = 1;
state = 1;
} |