Left and right shift operation

Left shift operation
2 << 2; find the value of i?

  //结果等于左操作数乘上2的右操作数次方,于是结果是8
    2*2²=8

Right shift operator
64 evaluates the number 2 >>

//结果等于左操作数除以右操作数次方,结果为16
64/(2²)=16
Published 23 original articles · won praise 1 · views 3141

Guess you like

Origin blog.csdn.net/qq_43669912/article/details/96469099