I have a pretty simple question. Is there a way to dynamically shift bitwise to the left OR to the right, e.g. depending on the sign of an int.
signed int n = 3;
signed int m = -2;
int number1 = 8;
int number2 = 8;
//number1 shift n;
//number2 shift m;
In this case I want to shift number1 3 bits to the left and number2 2 bits to the right. Is there a way without if else?
Does
?:count as anif-else?