位操作具体分类:提取、清0、置1
1.提取
#define GET_BIT(x, bit) ((x & (1 << bit)) >> bit) /* 获取第bit位 */
2.清0
#define CLEAR_BIT(x, bit) (x &= ~(1 << bit)) /* 清零第bit位 */
3.置1
#define SET_BIT(x, bit) (x |= (1 << bit)) /* 置位第bit位 */
REF:https://blog.csdn.net/pl0020/article/details/104813884