上下舍入至2的幂次
摘要:
4 int clp2(unsigned int n) 5 { 6 --n; 7 n = n | (n >> 1); 8 n = n | (n >> 2); 9 n = n | (n >> 4); 10 n = n | (n >> 8); 11 n = n | (n >> 16); 12 return n + 1; 13 }unsigned flp2 (unsigned x){ x = x | (x >> 1) x = x | (x >> 2) x = x | (x >> 4); x = x | (x 阅读全文
posted @ 2012-09-16 19:57 阿加 阅读(208) 评论(0) 推荐(0) 编辑