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

Implement left_rotate, right_rotate #38

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Conversation

kitsuyui
Copy link
Owner

@kitsuyui kitsuyui commented Jul 24, 2024

left_rotate and right_rotate are bit shift with rotation.
overflowed bits are moved to the other side.

example of left_rotate 1 bit
0b000000010b00000010
0b100000000b00000001

example of right_rotate 1 bit
0b100000000b01000000
0b000000010b10000000

left_rotate and right_rotate are bit shift with rotation.
overflowed bits are moved to the other side.

example of left_rotate 1 bit
  0b00000001 -> 0b00000010
  0b10000000 -> 0b00000001

example of right_rotate 1 bit
  0b10000000 -> 0b01000000
  0b00000001 -> 0b10000000
@kitsuyui kitsuyui merged commit 0ea1693 into main Jul 24, 2024
9 checks passed
@kitsuyui kitsuyui deleted the left-and-right-rotate branch July 24, 2024 15:59
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.

1 participant