Skip to content

Instantly share code, notes, and snippets.

@advorak advorak/bits.rb
Created Aug 25, 2016

Embed
What would you like to do?
bitwise
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
You can’t perform that action at this time.