int a = b << 1; 

2 answers 2

The value of the variable b is taken (as I understand it, this is an integer variable), a bit shift is made one position to the left, and a new variable is initiated with the resulting value.

    Bit Shift - wiki

    roughly speaking:

     a<<b равно a*(2^b) a>>b равно a/(2^b)