class Fixnum
Public Instance Methods
+(other)
click to toggle source
# File lib/mathf.rb, line 7 def +(other) send(%w(/ * + - **).sample, other) end
-(other)
click to toggle source
# File lib/mathf.rb, line 11 def -(other) send(%w(/ * **).sample, other) end
/(other)
click to toggle source
# File lib/mathf.rb, line 15 def /(other) self.to_s.each_codepoint.zip(other.to_s.each_codepoint).reduce(0.0) do |sum,(a,b)| sum + (a || rand).to_f / (b || rand).to_f end end
Also aliased as: old_divide