I'm trying to use bit shifting to accomplish fast divition by powers of 2. But I'm getting some strange behavior. For the example code below...
uint16_t var1; uint16_t var2; uint16_t basevar; basevar = 16; var1 = basevar >> 1; var2 = basevar >> 1;
Will the values in var1 and var2 both equal 8? or will var1 = 8 and var2 = 4?
Is the "basevar" variable value bit shifted JUST for the purposes of the equation? Or is the value stored in "basevar" itself shifted?