Sha256: 2b69be354fced134456637fc18eab47f78f276a4c37c60a1679876f148d66049

Contents?: true

Size: 197 Bytes

Versions: 2

Compression:

Stored size: 197 Bytes

Contents

class Fixnum
  def to_formatted_hex
    to_s(16).rjust(4,'0').upcase
  end

  def negate
      unsigned = ~self % (2**32)
      hex_string = unsigned.to_s(16)[-4,4]
      hex_string.hex
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
utc_rpn_calc-0.1.0 lib/utc_rpn_calc/core_ext/fixnum.rb
utc_rpn_calc-0.0.1 lib/utc_rpn_calc/core_ext/fixnum.rb