Class: Float

Inherits:
Object
  • Object
show all
Includes:
HexValuesFromFloat
Defined in:
lib/hex_values.rb

Instance Method Summary collapse

Methods included from HexValuesFromFloat

#to_hex

Instance Method Details

#*(other_obj) ⇒ Object



59
60
61
62
# File 'lib/hex_values.rb', line 59

def *(other_obj)
  return other_obj * self if other_obj.instance_of? Hexadecimal
  return old_multiply(other_obj)
end

#**(other_obj) ⇒ Object



69
70
71
72
# File 'lib/hex_values.rb', line 69

def **(other_obj)
  return self ** other_obj.to_float if other_obj.instance_of? Hexadecimal
  return old_pow(other_obj)
end

#+(other_obj) ⇒ Object



49
50
51
52
# File 'lib/hex_values.rb', line 49

def +(other_obj)
  return other_obj + self if other_obj.instance_of? Hexadecimal
  return old_sum(other_obj)
end

#-(other_obj) ⇒ Object



54
55
56
57
# File 'lib/hex_values.rb', line 54

def -(other_obj)
  return self.to_hex - other_obj if other_obj.instance_of? Hexadecimal
  return old_min(other_obj)
end

#/(other_obj) ⇒ Object



64
65
66
67
# File 'lib/hex_values.rb', line 64

def /(other_obj)
  return self.to_hex / other_obj if other_obj.instance_of? Hexadecimal
  return old_divide(other_obj)
end

#old_divideObject



46
# File 'lib/hex_values.rb', line 46

alias :old_divide :/

#old_minObject



44
# File 'lib/hex_values.rb', line 44

alias :old_min :-

#old_multiplyObject



45
# File 'lib/hex_values.rb', line 45

alias :old_multiply :*

#old_powObject



47
# File 'lib/hex_values.rb', line 47

alias :old_pow :**

#old_sumObject



43
# File 'lib/hex_values.rb', line 43

alias :old_sum :+