We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a04e64 commit 199ac7cCopy full SHA for 199ac7c
src/class05/Code03_BitAddMinusMultiDiv.java
@@ -41,7 +41,7 @@ public static int div(int a, int b) {
41
int x = isNeg(a) ? negNum(a) : a;
42
int y = isNeg(b) ? negNum(b) : b;
43
int res = 0;
44
- for (int i = 31; i >= 0; i = minus(i, 1)) {
+ for (int i = 30; i >= 0; i = minus(i, 1)) {
45
if ((x >> i) >= y) {
46
res |= (1 << i);
47
x = minus(x, y << i);
0 commit comments