Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve binary addition and substring issues in Karatsuba algorithm #2851

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 17, 2024

  1. 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.
    ShanawazAlam007 authored Oct 17, 2024
    Configuration menu
    Copy the full SHA
    f095ed3 View commit details
    Browse the repository at this point in the history