使某一变量(tmp)始终保持某一数(x)的倍数

来源:互联网 发布:单片机就业方向 编辑:程序博客网 时间:2024/05/19 17:25
通式:
int tmp = ((tmp + (x-1))&~(x-1));

int tmp = ((tmp + 3)&~(3));

阅读全文
0 0