boostorg / multiprecision

Boost.Multiprecision
Boost Software License 1.0
188 stars 112 forks source link

Correct divide-by-zero in cpp_int modulus operations. #625

Closed jzmaddock closed 1 month ago

jzmaddock commented 1 month ago

Also added some more efficient operator overloads for the trivial case. Fixes https://github.com/boostorg/multiprecision/issues/624

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.1%. Comparing base (f9fdcc2) to head (b0ea443).

:exclamation: Current head b0ea443 differs from pull request most recent head 891e2c3

Please upload reports for the commit 891e2c3 to get more accurate results.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/boostorg/multiprecision/pull/625/graphs/tree.svg?width=650&height=150&src=pr&token=SDDBym7Pc9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg)](https://app.codecov.io/gh/boostorg/multiprecision/pull/625?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg) ```diff @@ Coverage Diff @@ ## develop #625 +/- ## ========================================= + Coverage 94.1% 94.1% +0.1% ========================================= Files 274 275 +1 Lines 26766 26794 +28 ========================================= + Hits 25161 25188 +27 - Misses 1605 1606 +1 ``` | [Files](https://app.codecov.io/gh/boostorg/multiprecision/pull/625?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg) | Coverage Δ | | |---|---|---| | [test/git\_issue\_624.cpp](https://app.codecov.io/gh/boostorg/multiprecision/pull/625?src=pr&el=tree&filepath=test%2Fgit_issue_624.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg#diff-dGVzdC9naXRfaXNzdWVfNjI0LmNwcA==) | `100.0% <100.0%> (ø)` | | | [include/boost/multiprecision/cpp\_int/divide.hpp](https://app.codecov.io/gh/boostorg/multiprecision/pull/625?src=pr&el=tree&filepath=include%2Fboost%2Fmultiprecision%2Fcpp_int%2Fdivide.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg#diff-aW5jbHVkZS9ib29zdC9tdWx0aXByZWNpc2lvbi9jcHBfaW50L2RpdmlkZS5ocHA=) | `92.5% <83.4%> (-<0.1%)` | :arrow_down: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/boostorg/multiprecision/pull/625?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/boostorg/multiprecision/pull/625?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg). Last update [f9fdcc2...891e2c3](https://app.codecov.io/gh/boostorg/multiprecision/pull/625?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg).