diff --git a/Linkes-Twix b/Linkes-Twix new file mode 160000 index 0000000..b5e4367 --- /dev/null +++ b/Linkes-Twix @@ -0,0 +1 @@ +Subproject commit b5e43678fdb145c0146f369ab05bf758ae913abf diff --git a/src/multiplication.c b/src/multiplication.c index cf3b14c..c8dbe28 100644 --- a/src/multiplication.c +++ b/src/multiplication.c @@ -230,7 +230,7 @@ int bitwisee_multi(int num1, int num2) { return result; } -int karatsuba_multi(int num1, int num2) { +int karatsu_multi(int num1, int num2) { // Base case: If numbers are less than 10, return their product directly if (num1 < 10 || num2 < 10) { return num1 * num2; @@ -246,9 +246,9 @@ int karatsuba_multi(int num1, int num2) { int d = num2 % (int)pow(10, m2); // Calculate intermediate products - int ac = karatsuba_multi(a, c); - int bd = karatsuba_multi(b, d); - int ad_bc = karatsuba_multi(a + b, c + d) - ac - bd; + int ac = karatsu_multi(a, c); + int bd = karatsu_multi(b, d); + int ad_bc = karatsu_multi(a + b, c + d) - ac - bd; // Calculate the final result return ac * (int)pow(10, 2 * m2) + ad_bc * (int)pow(10, m2) + bd; diff --git a/src/multiplication.h b/src/multiplication.h index 88ade48..cf2b1a1 100644 --- a/src/multiplication.h +++ b/src/multiplication.h @@ -31,7 +31,7 @@ int repeated_division_multi(int num1, int num2); int bernoulli_multi(int num, int bernoulli); float power_multi(float base, int exponent); int bitwisee_multi(int num1, int num2); -int karatsuba_multi(int num1, int num2); +int karatsu_multi(int num1, int num2);