简体   繁体   English

java中的(long)和双劣是什么意思

[英]What does (long) and double inferior mean in java

I want to understand what this java line code does , especially (long) and <<7我想了解这个java行代码的作用,尤其是(长)和<<7

  BigInteger x = BigInteger.valueOf(((long) sourceArray[0]) << 7); 

If it's possible how to write it in R如果有可能如何在 R 中编写它

Thanks谢谢

(long) is casting the value of sourceArray[0] from the array's type into a long value. (long)sourceArray[0]的值从数组的类型转换为long值。

In java the << operation is a bitwise manipulation operation.在 Java 中, <<操作是按位操作。 This means that the base 2 version of sourceArray[0] is going to be "left shifted" 7 times.这意味着sourceArray[0]的 base 2 版本将被“左移”7 次。 You can check out this link for more information on bitwase operations: Bitwise operations您可以查看此链接以获取有关按位操作的更多信息:按位操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM