Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to express displacement in C language? For example, move a value two places to the left.
How to express displacement in C language? For example, move a value two places to the left.
Using bit operation: ">" means moving to the right.

For example, move A two places to the left and assign it to A..

A<& lt=2, that is, a = a

In C language, moving left 1 is equivalent to multiplying by 2 and moving right is equivalent to dividing by 2.