返回信息流u8 convert_from_bytes_to_power_of_two(u16 NumberOfBytes)
{
u8 count = 0;
while (NumberOfBytes != 1)
{
NumberOfBytes >>= 1;
count++;
}
return(count);
}
这是一条镜像帖。来源:北邮人论坛 / cpp / #81646同步于 2014/8/22
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
大家看看这个函数的作用是?????????????????
bewithyou
2014/8/22镜像同步7 回复
订阅后,新回复会通过你的通知中心匿名送达。
7 条回复
re。以二为底的对数,pow(2, count) == NumerOfBytes;
【 在 yxhyxh 的大作中提到: 】
: 没猜错的话应该是求NumberOfBytes的对数