class Integer
class Fixnum
include SGML def to_sgml "<mn #{sgml_id}class='fixnum'>#{self.to_s}</mn>" end undef quo def quo(other) Quotient.new!(self,1) / other end alias rdiv quo def rpower (other) if other >= 0 self.power!(other) else Quotient.new!(self,1)**other end end unless defined? 1.power! alias power! ** alias ** rpower end def is_0? self === 0 ? true : false end def to_N self > 0 ? Natural(self) : emptySet end def to_N0 self >= 0 ? Counting(self) : emptySet end def to_Z Zahlen(self) end def to_Frac Fraction(self,1) end def to_Q Quotient(self,1) end def to_Dec Decimal(self,0,'0') end def to_Sig Sigma(self.to_Q) end def to_K Kettenbruch(self.to_Frac) end def to_R naught end
end
Public Instance Methods
coerce(other)
click to toggle source
Calls superclass method
# File lib/m500.rb, line 433 def coerce(other) if Natural === other or Counting === other or Zahlen === other or Quotient === other or Fraction === other [other,self] else super end end
is_0?()
click to toggle source
# File lib/m500.rb, line 403 def is_0? self === 0 ? true : false end
quo(other)
click to toggle source
# File lib/m500.rb, line 389 def quo(other) Fraction.new!(self,1) / other end
Also aliased as: rdiv
rpower(other)
click to toggle source
# File lib/m500.rb, line 393 def rpower (other) if other >= 0 self.power!(other) else Fraction.new!(self, 1)**other end end
Also aliased as: **
to_Dec()
click to toggle source
# File lib/m500.rb, line 421 def to_Dec Decimal(self,0) end
to_Frac()
click to toggle source
# File lib/m500.rb, line 415 def to_Frac Fraction(self,Quotient(1,1)) end
to_K()
click to toggle source
# File lib/m500.rb, line 427 def to_K Kettenbruch(self.to_Frac) end
to_N()
click to toggle source
# File lib/m500.rb, line 406 def to_N self > 0 ? Natural(self) : emptySet end
to_N0()
click to toggle source
# File lib/m500.rb, line 409 def to_N0 self >= 0 ? Counting(self) : emptySet end
to_Q()
click to toggle source
# File lib/m500.rb, line 418 def to_Q Quotient(self,1) end
to_R()
click to toggle source
# File lib/m500.rb, line 430 def to_R naught end
to_Sig()
click to toggle source
# File lib/m500.rb, line 424 def to_Sig Sigma(self.to_Q) end
to_Z()
click to toggle source
# File lib/m500.rb, line 412 def to_Z Zahlen(self) end
to_sgml()
click to toggle source
# File lib/m500.rb, line 382 def to_sgml "<mn #{sgml_id}class='integer'>#{self.to_s}</mn>" end