for example, my definition looks like the following:
#define AA 0x0000000000000001LL
#define BB 0x0000000000000002LL
#define CC 0x0000000000000004LL
#define DD 0x0000000000000008LL
#define EE 0x0000000000000010LL
#define FF 0x0000000000000020LL
#define GG 0x0000000000000040LL
#define HH 0x0000000000000080LL
I would like to get the position of the first set bit (counting backwards from the least significant bit) from the maximum definition.
h = getAmountFromBitwise(HH);
output of h is 8;
b = getAmountFromBitwise(BB);
output b is 2;
Is there any better way to implement getAmountFromBitwise()?
int getAmountFromBitwise(long long input) {
2^x = input;
y=x+1;
return y;
}