当前位置:网站首页>Shift right operator

Shift right operator

2021-07-27 16:28:53 wx60f10a0d8664a

>> It's the shift right operator .

      
  • 1.

hypothesis x=5, that x The binary of is 0101,x>>1 Express x Move right 1 position , That is, the one on the far right 1 Delete , Turn into 010, here x=2;

Still set x=5, Binary system 0101,x>>2 Express x Move right 2 position , Put the two on the far right 01 Get rid of , Turn into 01, here x=1.

x>>=1 Equivalent to x=x>>1, Follow x+=1 Equivalent to x=x+1 It's one thing

eg: x >>= 1 amount to x = x / (21);
eg: x>>= 2 amount to x=x/(2
2)

版权声明
本文为[wx60f10a0d8664a]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/07/20210716150351055w.html