-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
Create karatsuba.py #1309
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
Create karatsuba.py #1309
Conversation
Added karatsuba algorithm for multiplication of two numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a doctest as discussed in CONTRIBUTING.md and simplify using Python builtin divmod().
Added doctests and divmod
>>> karatsuba(15463, 23489) == 15463 * 23489 | ||
True | ||
>>> karatsuba(3, 9) == 3 * 9 | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Create karatsuba.py (TheAlgorithms#1309)
* Create karatsuba.py Added karatsuba algorithm for multiplication of two numbers * Update karatsuba.py Added doctests and divmod * Update karatsuba.py
Added karatsuba algorithm for multiplication of two numbers