如 log2(65)=6; 经验算,最大支持2^32-1值的输入 Uint8 Log2EX(Uint32 x) { Uint8 i=0; for(i=31;i>=0;i--) { if(1 ==(x>>i)&0x1){ break; } } return i; }