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)


345
346
347
# File 'lib/m500.rb', line 345

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

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



330
331
332
# File 'lib/m500.rb', line 330

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

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



334
335
336
337
338
339
340
# File 'lib/m500.rb', line 334

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

#to_DecObject



363
364
365
# File 'lib/m500.rb', line 363

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

#to_FracObject



357
358
359
# File 'lib/m500.rb', line 357

def to_Frac
  Fraction(self,1)
end

#to_KObject



369
370
371
# File 'lib/m500.rb', line 369

def to_K
  Kettenbruch(self.to_Frac)
end

#to_NObject



348
349
350
# File 'lib/m500.rb', line 348

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

#to_N0Object



351
352
353
# File 'lib/m500.rb', line 351

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

#to_QObject



360
361
362
# File 'lib/m500.rb', line 360

def to_Q
  Quotient(self,1)
end

#to_RObject



372
373
374
# File 'lib/m500.rb', line 372

def to_R
  naught
end

#to_sgmlObject



326
327
328
# File 'lib/m500.rb', line 326

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

#to_SigObject



366
367
368
# File 'lib/m500.rb', line 366

def to_Sig
  Sigma(self.to_Q)
end

#to_ZObject



354
355
356
# File 'lib/m500.rb', line 354

def to_Z
  Zahlen(self)
end