为什么3758096384<< 1给予768 [英] Why does 3,758,096,384 << 1 give 768

查看:86
本文介绍了为什么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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆