module Rips::Utils::IntegerExtension
Public Instance Methods
to_bin(width)
click to toggle source
# File lib/rips/utils/integer.rb, line 5 def to_bin(width) if self < 0 '%0*b' % [width, (2**width-1) - ~self] else '%0*b' % [width, self] end end