unsigned long ccNextPOT(unsigned long x){
x = x - 1;
x = x | (x >> 1);
x = x | (x >> 2);
x = x | (x >> 4);
x = x | (x >> 8);
x = x | (x >>16);
return x + 1;
}
标签:
http://stackoverflow.com/questions/8637142/what-does-this-bit-manipulating-function-do
|
|||||||||||||
|
The OR and SHIFT statements fills with ones all bits of |
|||||
|
This function rounds x up to the next highest power of 2. It‘s exactly the code in here
|
||||
What does this bit-manipulating function do?
标签:
原文地址:http://www.cnblogs.com/xuejinhui/p/4341764.html