
class Numeric

  # Returns the distance between self an another value.
  # This is the same as #- but it provides an alternative
  # for common naming between variant classes.
  #
  #   4.distance(3)  #=> 1
  #
  def distance( other )
    self - other
  end

end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCNumeric < Test::Unit::TestCase

    def test_distance
      assert_equal( 4, 10.distance(6) )
      assert_equal( 2, 10.distance(8) )
      assert_equal( -2, 7.distance(9) )
    end

  end

=end
