Skip to content

Conversation

@AliAlimohammadi
Copy link
Contributor

Description

This PR adds a two's complement implementation to the bit manipulation module.

Type of change

  • New algorithm implementation

Changes

  • Added twos_complement.rs with comprehensive documentation
  • Includes 12 test cases covering edge cases and error handling
  • Follows Rust best practices and TheAlgorithms conventions

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@AliAlimohammadi
Copy link
Contributor Author

@siriak, this is ready to be merged.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.66%. Comparing base (00cbbb9) to head (0ad36a2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #968      +/-   ##
==========================================
+ Coverage   95.61%   95.66%   +0.05%     
==========================================
  Files         341      342       +1     
  Lines       22273    22330      +57     
==========================================
+ Hits        21296    21362      +66     
+ Misses        977      968       -9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@siriak siriak merged commit e5bceac into TheAlgorithms:master Dec 15, 2025
9 of 10 checks passed
@AliAlimohammadi AliAlimohammadi deleted the add-twos-complement branch December 16, 2025 00:51
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.

3 participants