Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Snippets] Added a few bit-manipulation snippets in C#242

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@aelshinawy
Copy link
Contributor

Description

I added a few essential bit-manipulation snippets in C

1. Get i-th bit:  Get the i-th bit of a number
2. Set i-th bit:  Set the i-th bit of a number and returns the resulting number
3. Clear i-th bit:  Clear the ith bit of a number and returns the resulting number
4. Toggle i-th bit:  Toggle the i-th bit of a number and returns the resulting number
5. Count set bits:  Counts the number of set bits in an int
6. Is Odd:  Check if a number is odd
7. Swap Numbers:  Swap two numbers without a temporary variable

Type of Change

  • ✨ New snippet
  • 🛠 Improvement to an existing snippet
  • 🐞 Bug fix
  • 📖 Documentation update
  • 🔧 Other (please describe):

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • Documentation has been updated (if applicable).
  • There are no new warnings or errors from my changes.

Related Issues

Closes #

Additional Context

Screenshots (Optional)

Click to view screenshots

@aelshinawyaelshinawy changed the titleAdded a few bit-manipulation snippets in C[Snippets] Added a few bit-manipulation snippets in CJan 22, 2025
@Mathys-GasnierMathys-Gasnier merged commitcbb3118 intoquicksnip-dev:mainJan 26, 2025
2 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@majvaxmajvaxmajvax approved these changes

@Mathys-GasnierMathys-GasnierMathys-Gasnier approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@aelshinawy@majvax@Mathys-Gasnier

[8]ページ先頭

©2009-2025 Movatter.jp