Which of the following techniques is the best option for dividing an integer by 2 and why?
x = x >> 1;
x = x / 2;
Use the operation that best describes what you are trying to do.
Note that they are not exactly equivalent. They can give different results for negative integers. For example:
-5 / 2 = -2 -5 >> 1 = -3