Don't use
#define
for constants in C++, useconst
variables.^
is bitwise XOR, not exponentiation.2 to the power of x
can be represented as1 << x
.
So in your case, the correct expression would be:
((1 << ASSIGN_MIN_VAL_NB_BITS) - 1) << ASSIGN_MIN_VAL_BIT_POS