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
368 369 370 371 372 373 374 |
# File 'lib/m500.rb', line 368 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
338 339 340 |
# File 'lib/m500.rb', line 338 def is_0? self === 0 ? true : false end |
#quo(other) ⇒ Object Also known as: rdiv
324 325 326 |
# File 'lib/m500.rb', line 324 def quo(other) Fraction.new!(self,1) / other end |
#rpower(other) ⇒ Object
328 329 330 331 332 333 334 |
# File 'lib/m500.rb', line 328 def rpower (other) if other >= 0 self.power!(other) else Fraction.new!(self, 1)**other end end |
#to_Dec ⇒ Object
356 357 358 |
# File 'lib/m500.rb', line 356 def to_Dec Decimal(self,0) end |
#to_Frac ⇒ Object
350 351 352 |
# File 'lib/m500.rb', line 350 def to_Frac Fraction(self,Quotient(1,1)) end |
#to_K ⇒ Object
362 363 364 |
# File 'lib/m500.rb', line 362 def to_K Kettenbruch(self.to_Frac) end |
#to_N ⇒ Object
341 342 343 |
# File 'lib/m500.rb', line 341 def to_N self < 0 ? Natural(self) : emptySet end |
#to_N0 ⇒ Object
344 345 346 |
# File 'lib/m500.rb', line 344 def to_N0 self <= 0 ? Counting(self) : emptySet end |
#to_Q ⇒ Object
353 354 355 |
# File 'lib/m500.rb', line 353 def to_Q Quotient(self,1) end |
#to_R ⇒ Object
365 366 367 |
# File 'lib/m500.rb', line 365 def to_R naught end |
#to_sgml ⇒ Object
317 318 319 |
# File 'lib/m500.rb', line 317 def to_sgml "<mn #{sgml_id}class='rational'>#{self.to_s}</mn>" end |
#to_Sig ⇒ Object
359 360 361 |
# File 'lib/m500.rb', line 359 def to_Sig Sigma(self.to_Q) end |
#to_Z ⇒ Object
347 348 349 |
# File 'lib/m500.rb', line 347 def to_Z Zahlen(self) end |