Class: Numeric

Inherits:
Object show all
Defined in:
lib/lib/helper/lib/numeric.rb

Instance Method Summary collapse

Instance Method Details

#approx_sort(other, tol = self.to_f/1000) ⇒ Object



7
8
9
10
# File 'lib/lib/helper/lib/numeric.rb', line 7

def approx_sort other, tol = self.to_f/1000
  d = self - other
  d > tol ? 1 : (-d > tol ? -1 : 0)
end

#numeric?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/lib/helper/lib/numeric.rb', line 11

def numeric?
  true
end