class Integer

Public Class Methods

euclidian?() click to toggle source

def self.field?; respond_to?(:from_prime_division); end mathn loaded

# File lib/algebra/numeric-supplement.rb, line 89
def self.euclidian?
  true
end
field?() click to toggle source
# File lib/algebra/numeric-supplement.rb, line 84
def self.field?
  false
end
ground() click to toggle source
# File lib/algebra/numeric-supplement.rb, line 80
def self.ground
  self
end

Public Instance Methods

devide?(other) click to toggle source
# File lib/algebra/numeric-supplement.rb, line 93
def devide?(other)
  case other
  when Integer
    (other % self).zero?
  else
    # this case will occur when mathn is required
    (other / self) * self == other
    #      raise "devide?: unkown self.class(#{other})"
  end
end