final changes

This commit is contained in:
2024-02-20 11:22:31 +05:30
parent 7fc56474a9
commit 862a02c7b3
7 changed files with 485 additions and 2 deletions

13
bitmaps_imp/bitsop.h Normal file
View File

@@ -0,0 +1,13 @@
/* Assuming least significant bit starts from 0th bit*/
#ifndef __BITS__
#define __BITS__
#define IS_BIT_SET(n, pos) ((n & (1 << (pos))) != 0)
#define TOGGLE_BIT(n, pos) (n = n ^ (1 << (pos)))
#define COMPLEMENT(num) (num = num ^ 0xFFFFFFFF)
#define UNSET_BIT(n, pos) (n = n & ((1 << pos) ^ 0xFFFFFFFF))
#define SET_BIT(n, pos) (n = n | 1 << pos)
#endif