-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolve binary addition and substring issues in Karatsuba algorithm
fix: correct binary addition and substring handling in the Karatsuba algorithm - Fixed the `add_strings` function to handle binary addition correctly. - Improved the `safe_substr` function to manage leading zeros and extract substrings properly. - Ensured correct bit shifting by using `1LL <<` for 64-bit integers. - Added comprehensive self-tests to verify functionality. This fixes incorrect results from the Karatsuba algorithm for binary multiplication.
- Loading branch information
1 parent
e841605
commit f095ed3
Showing
1 changed file
with
32 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters