Skip to content

Commit 199ac7c

Browse files
committed
modify code
1 parent 6a04e64 commit 199ac7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/class05/Code03_BitAddMinusMultiDiv.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static int div(int a, int b) {
4141
int x = isNeg(a) ? negNum(a) : a;
4242
int y = isNeg(b) ? negNum(b) : b;
4343
int res = 0;
44-
for (int i = 31; i >= 0; i = minus(i, 1)) {
44+
for (int i = 30; i >= 0; i = minus(i, 1)) {
4545
if ((x >> i) >= y) {
4646
res |= (1 << i);
4747
x = minus(x, y << i);

0 commit comments

Comments
 (0)