module BitCounter
module for bit counting @deprecated use ‘bit_utils`.
Constants
- VERSION
Public Instance Methods
count(num)
click to toggle source
counts bits in Integer. @return [Integer] num the number of bits.
if positive number is given, count 1 bits. if negative number is given, count 0 bits and -(count) is returned.
@raise [TypeError] when non-Integer was given.
# File lib/bit_counter.rb, line 19 def count(num) BitUtils.popcount(num) end