日期:2014-05-16  浏览次数:20673 次

我也来个愚的问题
static void update_avg(u64 *avg, u64 sample)
{
s64 diff = sample - *avg;
*avg += diff >> 3;
}

*avg += diff >> 3;为什么呢??


------解决方案--------------------
什么为什么, 楼主说清楚噻
------解决方案--------------------
探讨

diff >> 3
为什么要右移动3位??