Last active
April 8, 2018 16:35
-
-
Save leonid-ed/5684679 to your computer and use it in GitHub Desktop.
Macros for bit's manipulation: get bit, set bit, reset bit.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define GET_BIT(X,N) ( ( (X) >> (N) ) & 1 ) | |
#define SET_BIT(X,N) ( (X) | (1 << (N) ) ) | |
#define RST_BIT(X,N) ( (X) & ~(1 << (N) ) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
But to use mask of bits is a better way! =)