Java binary shift operations
Posted: Plexton Date: 24.05.2017
Of course, you must be sure that you are not shifting any bits off the right end. Flags can be cleared by ANDing them with a bitmask, where each bit with the value zero will clear the corresponding flag, if it isn't already cleared. It uses xor to exchange two values x and y...