What is the Left Shift operator (<<) doing mathematically?

Updated Apr 28, 2026

Short answer

It multiplies a number by 2 for every shift position.

Deep explanation

Bit manipulation at the hardware level is faster than arithmetic. It multiplies a number by 2 for every shift position. This is fundamental for low-level optimization.

Real-world example

Flag management in simple game engines.

Common mistakes

  • Forgetting that bitwise operators have lower precedence than comparison operators.

Follow-up questions

  • What is 1 << 3?

More Bit Manipulation interview questions

View all →