Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
30.82k
stars
7.29k
forks
source link
fix: resolve binary addition and substring issues in Karatsuba algorithm #2851
Closed
ShanawazAlam007 closed 2 weeks ago
fix: correct binary addition and substring handling in the Karatsuba algorithm
add_strings
function to handle binary addition correctly.safe_substr
function to manage leading zeros and extract substrings properly.1LL <<
for 64-bit integers.This fixes incorrect results from the Karatsuba algorithm for binary multiplication.
Description of Change
Checklist
Notes: