Class: Bignum
Instance Method Summary collapse
- #coerce(other) ⇒ Object
- #is_0? ⇒ Boolean
- #quo(other) ⇒ Object (also: #rdiv)
- #rpower(other) ⇒ Object
- #to_Dec ⇒ Object
- #to_Frac ⇒ Object
- #to_K ⇒ Object
- #to_N ⇒ Object
- #to_N0 ⇒ Object
- #to_Q ⇒ Object
- #to_R ⇒ Object
- #to_sgml ⇒ Object
- #to_Sig ⇒ Object
- #to_Z ⇒ Object
Methods included from SGML
Instance Method Details
#coerce(other) ⇒ Object
429 430 431 432 433 434 435 |
# File 'lib/m500.rb', line 429 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? ⇒ Boolean
399 400 401 |
# File 'lib/m500.rb', line 399 def is_0? self === 0 ? true : false end |
#quo(other) ⇒ Object Also known as: rdiv
385 386 387 |
# File 'lib/m500.rb', line 385 def quo(other) Fraction.new!(self,1) / other end |
#rpower(other) ⇒ Object
389 390 391 392 393 394 395 |
# File 'lib/m500.rb', line 389 def rpower (other) if other >= 0 self.power!(other) else Fraction.new!(self, 1)**other end end |
#to_Dec ⇒ Object
417 418 419 |
# File 'lib/m500.rb', line 417 def to_Dec Decimal(self,0) end |
#to_Frac ⇒ Object
411 412 413 |
# File 'lib/m500.rb', line 411 def to_Frac Fraction(self,Quotient(1,1)) end |
#to_K ⇒ Object
423 424 425 |
# File 'lib/m500.rb', line 423 def to_K Kettenbruch(self.to_Frac) end |
#to_N ⇒ Object
402 403 404 |
# File 'lib/m500.rb', line 402 def to_N self < 0 ? Natural(self) : emptySet end |
#to_N0 ⇒ Object
405 406 407 |
# File 'lib/m500.rb', line 405 def to_N0 self <= 0 ? Counting(self) : emptySet end |
#to_Q ⇒ Object
414 415 416 |
# File 'lib/m500.rb', line 414 def to_Q Quotient(self,1) end |
#to_R ⇒ Object
426 427 428 |
# File 'lib/m500.rb', line 426 def to_R naught end |
#to_sgml ⇒ Object
378 379 380 |
# File 'lib/m500.rb', line 378 def to_sgml "<mn #{sgml_id}class='rational'>#{self.to_s}</mn>" end |
#to_Sig ⇒ Object
420 421 422 |
# File 'lib/m500.rb', line 420 def to_Sig Sigma(self.to_Q) end |
#to_Z ⇒ Object
408 409 410 |
# File 'lib/m500.rb', line 408 def to_Z Zahlen(self) end |