简体   繁体   中英

What does (long) and double inferior mean in java

I want to understand what this java line code does , especially (long) and <<7

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

If it's possible how to write it in R

Thanks

(long) is casting the value of sourceArray[0] from the array's type into a long value.

In java the << operation is a bitwise manipulation operation. This means that the base 2 version of sourceArray[0] is going to be "left shifted" 7 times. You can check out this link for more information on bitwase operations: Bitwise operations

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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