Skip to content

Conversation

AnshumanAryan24
Copy link

Added the following:
Bit-Manipulation: Rotate right and rotate left.
Note: Only applicable for positive integers

  1. rotate_right(num, times): rotate num(passed as decimal) "times" times towards right and return
    eg.: rotate_right(12, 1) --> 6
  2. rotate_left(num, times): rotate num(passed as decimal) "times" times towards left and return
    eg.: rotate_left(12, 2) --> 3
    Additional functions:
  3. unsigned dec_to_bin(num): return decimal form of binary format number
    eg.: dec_to_bin(12) --> 1100
  4. unsigned bin_to_dec(bin): return binary form of decimal format number
    eg.: bin_to_dec(1100) --> 12

Added the following:
Bit-Manipulation: Rotate right and rotate left.
Note: Only applicable for positive integers
1. rotate_right(num, times): rotate num(passed as decimal) "times" times towards right and return
eg.: rotate_right(12, 1) --> 6
2. rotate_left(num, times): rotate num(passed as decimal) "times" times towards left and return
eg.: rotate_left(12, 2) --> 3
Additional functions: 
3. unsigned dec_to_bin(num): return decimal form of binary format number
eg.: dec_to_bin(12) --> 1100
4. unsigned bin_to_dec(bin): return binary form of decimal format number
eg.: bin_to_dec(1100) --> 12
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