Skip to content

Create karatsuba.py - #1309

Merged
cclauss merged 3 commits into
TheAlgorithms:masterfrom
rishabh0098:master
Oct 8, 2019
Merged

Create karatsuba.py#1309
cclauss merged 3 commits into
TheAlgorithms:masterfrom
rishabh0098:master

Conversation

@rishabh0098

Copy link
Copy Markdown
Contributor

Added karatsuba algorithm for multiplication of two numbers

Added karatsuba algorithm for multiplication of two numbers

@cclausscclauss left a comment

Copy link
Copy Markdown
Member

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().

Comment threadmaths/karatsuba.py Outdated
Comment threadmaths/karatsuba.py
Comment threadmaths/karatsuba.py
Added doctests and divmod
Comment threadmaths/karatsuba.py
>>> karatsuba(15463, 23489) == 15463 * 23489
True
>>> karatsuba(3, 9) == 3 * 9
"""

Copy link
Copy Markdown
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
Copy Markdown
Member

@cclausscclauss left a comment

Copy link
Copy Markdown
Member

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:masterOct 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 freeto 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

@rishabh0098@cclauss