Skip to content

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

Merged
merged 3 commits into from
Oct 8, 2019
Merged

Create karatsuba.py #1309

merged 3 commits into from
Oct 8, 2019

Conversation

rishabh0098
Copy link
Contributor

Added karatsuba algorithm for multiplication of two numbers

Added karatsuba algorithm for multiplication of two numbers
Copy link
Member

@cclauss cclauss left a 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
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True

@cclauss
Copy link
Member

cclauss commented Oct 8, 2019

Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@cclauss cclauss merged commit 61f7f94 into TheAlgorithms:master Oct 8, 2019
fengjixuchui added a commit to fengjixuchui/Python that referenced this pull request Oct 8, 2019
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Create karatsuba.py

Added karatsuba algorithm for multiplication of two numbers

* Update karatsuba.py

Added doctests and divmod

* Update karatsuba.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants