Displacement differences in Java and C – how to reconcile

I have some code in C, I'm trying to migrate to Java, and there's a problem I can't solve@ H_ 301_ 7@

Solution

C code seems to run as a 32 - bit integer Use Java 32-bit integer type int, code @ H_ 301_ 7@

int h = 594076817;
System.out.println(h << 10);
long h = 594076817L;
System.out.println(h << 10);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>