I need to compute a number (a/(2**b) using only bitwise operators such as ! & ^ ~ and shifts. I was given the following hint but I'm new to C and I dont know what the code means:
int bias = x>0 ? 0 : ((1<<n)-1);
Can anyone explain it to me?
I thought a>>b would work but I dont think it works for negative numbers.