本文介绍了为什么3758096384<< 1给予768的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
阅读伟大的答案
我测试的索赔(原文如此):
3758096384<< 1
从Chrome的控制台:
3758096384<< 1> 7683758096384<< 2> 15363758096384<< 1> -1073741824
解决方案
这是工作中的逗号操作符。它实际上是 384 LT;< 1
。 (逗号运算符的左边,然后评估其右侧,并返回右侧)。
After reading the great answer for Absolute Beginner's Guide to Bit Shifting?I tested the claim (sic):
3,758,096,384 << 1
from Chrome console:
3,758,096,384 << 1
> 768
3,758,096,384 << 2
> 1536
3758096384 << 1
> -1073741824
解决方案
That's the comma operator at work. It's actually 384 << 1
. (The comma operator evaluates its left hand side, then evaluates its right hand side, and returns the right hand side.)
这篇关于为什么3758096384&LT;&LT; 1给予768的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!