[]

fix[n] â 0, 1
Instance Public methods

Bit ReferenceâReturns the nth bit in the binary representation of fix, where fix is the least significant bit.

a = 0b11001100101010
30.downto(0) do |n| print a[n] end

produces:

0000000000000000011001100101010
doc_ruby_on_rails
2015-04-06 23:24:12
Comments
Leave a Comment

Please login to continue.