Class: Fixnum
- Inherits:
-
Object
- Object
- Fixnum
- Defined in:
- lib/utc_rpn_calc/core_ext/fixnum.rb
Instance Method Summary collapse
Instance Method Details
#negate ⇒ Object
6 7 8 9 10 |
# File 'lib/utc_rpn_calc/core_ext/fixnum.rb', line 6 def negate unsigned = ~self % (2**32) hex_string = unsigned.to_s(16)[-4,4] hex_string.hex end |
#to_formatted_hex ⇒ Object
2 3 4 |
# File 'lib/utc_rpn_calc/core_ext/fixnum.rb', line 2 def to_formatted_hex to_s(16).rjust(4,'0').upcase end |