This pull request addresses a bug in the add_strings function located in divide_and_conquer/karatsuba_algorithm_for_fast_multiplication.cpp. The original implementation incorrectly used bitwise XOR and character casting for binary addition, leading to incorrect results during binary multiplication. The updated code uses proper integer arithmetic to handle binary addition correctly, ensuring accurate summation of binary strings.
Fixes #2848 (Incorrect Binary Addition Logic in add_strings).
Description of Change
This pull request addresses a bug in the
add_strings
function located individe_and_conquer/karatsuba_algorithm_for_fast_multiplication.cpp
. The original implementation incorrectly used bitwise XOR and character casting for binary addition, leading to incorrect results during binary multiplication. The updated code uses proper integer arithmetic to handle binary addition correctly, ensuring accurate summation of binary strings.Fixes #2848 (Incorrect Binary Addition Logic in add_strings).
Checklist
Notes: This fix corrects the binary addition logic, ensuring accurate results for binary multiplication.