虽然有无符号不影响加减法、位运算等操作,但是乘法和除法的指令分mul、p以及imul、ip两套的。
如果JAVA编程需要用到无符号乘除法怎么办?
PHPz2017-04-17 14:26:54
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.
ringa_lee2017-04-17 14:26:54
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
PHP中文网2017-04-17 14:26:54
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?