Created
August 25, 2016 06:43
-
-
Save advorak/aee9b55574dc0ad272fab6334a225b27 to your computer and use it in GitHub Desktop.
bitwise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
starting_point = 0b11011101 | |
ending_point = 0b10111001 | |
bits_to_change = starting_point ^ ending_point #=> "0b01100100" | |
on_bits = ending_point & bits_to_change #=> "0b00100000" | |
off_bits = starting_point & bits_to_change#=> "0b01000100" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment