Method: BitInt.U

Defined in:
lib/bitint/bitint.rb

.U(bits) ⇒ subclass of Base Also known as: unsigned

Helper to create new unsigned Base classes.

This method just wraps BitInt::Base.create

Example

puts BitInt::U(16)::MAX #=> 65535

Parameters:

  • bits (Integer)

    number of bits; must be nonzero

Returns:

  • (subclass of Base)

    a Class that inherits from Base



18
# File 'lib/bitint/bitint.rb', line 18

def U(bits) = Base.create(bits: bits, signed: false)