TheAlgorithms / Rust

All Algorithms implemented in Rust
MIT License
22.21k stars 2.17k forks source link

feat: add `multiply.rs` #716

Closed mengfansheng-git closed 4 months ago

mengfansheng-git commented 4 months ago

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 commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mengfansheng-git commented 4 months ago

This clippy error should be a machine issue?

vil02 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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

mengfansheng-git commented 4 months ago

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

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

vil02 commented 4 months ago

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 commented 4 months ago

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