I am learning about Karatsuba-Ofman multiplication. I don't quite understand how to multiply two numbers with odd length.
Let's take two 3-digit numbers $a = 234; b = 857$ with base $B = 10$ and length $n=3$.
The first step is to split split $a$ and $b$ at position $n/2$. However, since $n=3$ where do I split it? Does it even matter?
Later in the algorithm I have to multiply $((a_1 + a_0) \cdot (b_1 + b_0) - (a_1 \cdot b_1) - (a_0 \cdot b_0)) \cdot B^{n/2}$. Would that mean, with $n=3$, I have to multiply by $B^{1.5}$?
a,b,c,d
is preserved but m=1, which leads to my final calculation being wrong. So this comment is the answer I would accept. $\endgroup$a,b,c,d
was the same butm
was 1, which affected the final calculation, but with your padding suggestion,a,b,c,d
were the same butm
was 2. If this was an answer I would upvote. $\endgroup$