Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integer bits can be addressed using array syntax:
n = 21 n[0] # => 1 n[1] # => 0 n[2] # => 1 # etc.. To generate an array of bits from an integer: number_of_bits = Math.sqrt(n).ceil # => 5 number_of_bits.times.map { |i| n[i] } # => [1, 0, 1, 0, 1]
- Loading branch information