雖然有無符號不影響加減法、位運算等操作,但是乘法和除法的指令分mul、p以及imul、ip兩套的。
如果JAVA編程需要用到無符號乘除法怎么辦?
歡迎選擇我的課程,讓我們一起見證您的進步~~
If your source data is unsigned, that is, when it is less than Integer.MAX_VALUE and greater than or equal to 0, direct calculation is unsigned calculation. But if the data is actually larger than Integer.MAX_VALUE, you can use long to calculate it. If long is not enough, you can also use BigInteger.
It depends on the number of digits. If it is greater than int, use long. If long is not enough, use BigInteger, or simply use BigInteger directly
Aren’t unsigned and signed operations the same in Java? Unsigned is nothing more than all positive numbers. What does the author want to express?