Class: Integer

Inherits:
Numeric show all
Includes:
Algebra::EuclidianRing
Defined in:
lib/algebra/euclidian-ring.rb,
lib/algebra/numeric-supplement.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Algebra::EuclidianRing

#cont, #cont_pp, #gcd, #gcd3, #gcd_all, #gcd_coeff0, #gcd_coeff_all, #gcd_ext, #gcd_rec, #lcm, #lcm_all, #pgcd, #pp

Methods inherited from Numeric

const, #each, indeterminate, #inverse, #monomial?, #pdivmod, regulate, ufd?, #unit?, #unity, unity, #unity?, zero, #zero

Class Method Details

.euclidian?Boolean

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

Returns:



89
90
91
# File 'lib/algebra/numeric-supplement.rb', line 89

def self.euclidian?
  true
end

.field?Boolean

Returns:



84
85
86
# File 'lib/algebra/numeric-supplement.rb', line 84

def self.field?
  false
end

.groundObject



80
81
82
# File 'lib/algebra/numeric-supplement.rb', line 80

def self.ground
  self
end

Instance Method Details

#devide?(other) ⇒ Boolean

Returns:



93
94
95
96
97
98
99
100
101
102
# 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