What does the '<<' operator do in Go when used with integers?

  • Divides two integers
  • Left shifts the bits of an integer
  • Multiplies two integers
  • Right shifts the bits of an integer
In Go, the '<<' operator performs a left shift operation on the bits of an integer. It moves each bit to the left by a specified number of positions, effectively multiplying the integer by 2 raised to the power of the shift count.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *