Class: Fixnum

Inherits:
Object
  • Object
show all
Includes:
SGML
Defined in:
lib/m500.rb

Instance Method Summary collapse

Methods included from SGML

#sgml_id, #tog_sgml_id

Instance Method Details

#is_0?Boolean

Returns:

  • (Boolean)


284
285
286
# File 'lib/m500.rb', line 284

def is_0?
  self === 0 ? true : false
end

#quo(other) ⇒ Object Also known as: rdiv



269
270
271
# File 'lib/m500.rb', line 269

def quo(other)
  Quotient.new!(self,1) / other
end

#rpower(other) ⇒ Object Also known as: **



273
274
275
276
277
278
279
# File 'lib/m500.rb', line 273

def rpower (other)
  if other >= 0
    self.power!(other)
  else
    Quotient.new!(self,1)**other
  end
end

#to_DecObject



302
303
304
# File 'lib/m500.rb', line 302

def to_Dec
  Decimal(self,0,'0')
end

#to_FracObject



296
297
298
# File 'lib/m500.rb', line 296

def to_Frac
  Fraction(self,1)
end

#to_KObject



308
309
310
# File 'lib/m500.rb', line 308

def to_K
  Kettenbruch(self.to_Frac)
end

#to_NObject



287
288
289
# File 'lib/m500.rb', line 287

def to_N
  self > 0 ? Natural(self) : emptySet
end

#to_N0Object



290
291
292
# File 'lib/m500.rb', line 290

def to_N0
  self >= 0 ? Counting(self) : emptySet
end

#to_QObject



299
300
301
# File 'lib/m500.rb', line 299

def to_Q
  Quotient(self,1)
end

#to_RObject



311
312
313
# File 'lib/m500.rb', line 311

def to_R
  naught
end

#to_sgmlObject



265
266
267
# File 'lib/m500.rb', line 265

def to_sgml
  "<mn #{sgml_id}class='fixnum'>#{self.to_s}</mn>"
end

#to_SigObject



305
306
307
# File 'lib/m500.rb', line 305

def to_Sig
  Sigma(self.to_Q)
end

#to_ZObject



293
294
295
# File 'lib/m500.rb', line 293

def to_Z
  Zahlen(self)
end