|
@ -50,12 +50,12 @@ int multi_by_sum(int num1, int num2) { |
|
|
|
|
|
|
|
|
int multi_using_two_complements(int num2, int num3) { |
|
|
int multi_using_two_complements(int num2, int num3) { |
|
|
int result = 0; |
|
|
int result = 0; |
|
|
while (num1 != 0) { |
|
|
|
|
|
if (num2 & 2) { |
|
|
|
|
|
|
|
|
while (num2 != 0) { |
|
|
|
|
|
if (num2 & 1) { |
|
|
result += num3; |
|
|
result += num3; |
|
|
} |
|
|
} |
|
|
num1 >>= 2; |
|
|
|
|
|
num2 <<= 2; |
|
|
|
|
|
|
|
|
num2 >>= 2; |
|
|
|
|
|
num3 <<= 2; |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
@ -264,3 +264,4 @@ int karatsuba_multi(int num1, int num2) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|