Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/jinni/numeric.rb
Instance Method Summary collapse
-
#bits ⇒ Object
utility method to return the number of bits that the binary representation of the number requires.
-
#to_binary ⇒ Object
utility method to convert a numeric into a binary string.
Instance Method Details
#bits ⇒ Object
utility method to return the number of bits that the binary representation of the number requires
9 10 11 |
# File 'lib/jinni/numeric.rb', line 9 def bits to_binary.length() end |
#to_binary ⇒ Object
utility method to convert a numeric into a binary string.
3 4 5 |
# File 'lib/jinni/numeric.rb', line 3 def to_binary to_s(2) end |