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

feat: add multiply.rs #716

Merged
merged 11 commits into from
May 23, 2024
Merged

feat: add multiply.rs #716

merged 11 commits into from
May 23, 2024

Conversation

mengfansheng-git
Copy link
Contributor

Given two non-negative integers num1 and num2 expressed as strings, returns the product of num1 and num2, which is also expressed as a string.
Note: You cannot use any of the built-in BigInteger libraries or directly convert the input to an integer.

@codecov-commenter
Copy link

codecov-commenter commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.96%. Comparing base (bba0b0d) to head (78623af).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #716   +/-   ##
=======================================
  Coverage   94.95%   94.96%           
=======================================
  Files         302      303    +1     
  Lines       22527    22563   +36     
=======================================
+ Hits        21390    21426   +36     
  Misses       1137     1137           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/string/multiply.rs Outdated Show resolved Hide resolved
src/string/multiply.rs Outdated Show resolved Hide resolved
src/string/multiply.rs Outdated Show resolved Hide resolved
src/string/multiply.rs Outdated Show resolved Hide resolved
src/string/multiply.rs Outdated Show resolved Hide resolved
src/string/multiply.rs Outdated Show resolved Hide resolved
src/string/multiply.rs Outdated Show resolved Hide resolved
DIRECTORY.md Outdated Show resolved Hide resolved
@mengfansheng-git
Copy link
Contributor Author

mengfansheng-git commented May 16, 2024

This clippy error should be a machine issue?

@vil02
Copy link
Member

vil02 commented May 16, 2024

This clippy error should be a machine issue

I think these errors are related to the recent update of the clippy. I will make a suitable fix in the evening.

@mengfansheng-git
Copy link
Contributor Author

This clippy error should be a machine issue

I think these errors are related to the recent update of the clippy. I will make a suitable fix in the evening.

ok

@vil02 vil02 mentioned this pull request May 16, 2024
7 tasks
@vil02
Copy link
Member

vil02 commented May 16, 2024

When you will update/rebase your branch, the CI should pass.

Copy link
Member

@vil02 vil02 left a comment

Choose a reason for hiding this comment

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

multiply("03", "2") returns "06".

src/big_integer/multiply.rs Outdated Show resolved Hide resolved
src/big_integer/multiply.rs Outdated Show resolved Hide resolved
src/big_integer/multiply.rs Outdated Show resolved Hide resolved
@mengfansheng-git
Copy link
Contributor Author

multiply("03", "2")返回"06"

multiply2: ("03", "2", "06")
multiply3: ("03", "02", "006")
It currently returns. Do I need to add it to test?

@vil02
Copy link
Member

vil02 commented May 20, 2024

multiply("03", "2")返回"06"

multiply2: ("03", "2", "06") multiply3: ("03", "02", "006") It currently returns. Do I need to add it to test?

I would suggest to exclude inputs like "03", "003" or "X3", simply because they are not properly formatted numbers.

@mengfansheng-git
Copy link
Contributor Author

multiply("03", "2")返回"06"

multiply2: ("03", "2", "06") multiply3: ("03", "02", "006") It currently returns. Do I need to add it to test?

I would suggest to exclude inputs like "03", "003" or "X3", simply because they are not properly formatted numbers.

I'll add a string formatting judgment

src/big_integer/multiply.rs Outdated Show resolved Hide resolved
src/big_integer/multiply.rs Outdated Show resolved Hide resolved
src/big_integer/multiply.rs Outdated Show resolved Hide resolved
src/big_integer/multiply.rs Outdated Show resolved Hide resolved
src/big_integer/multiply.rs Outdated Show resolved Hide resolved
src/big_integer/multiply.rs Outdated Show resolved Hide resolved
@vil02 vil02 changed the title add multiply.rs feat: add multiply.rs May 23, 2024
@vil02 vil02 merged commit c2009cd into TheAlgorithms:master May 23, 2024
4 checks passed
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.

None yet

4 participants