Class: Fixnum
Instance Method Summary collapse
- #is_0? ⇒ Boolean
- #quo(other) ⇒ Object (also: #rdiv)
- #rpower(other) ⇒ Object (also: #**)
- #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
#is_0? ⇒ 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_Dec ⇒ Object
302 303 304 |
# File 'lib/m500.rb', line 302 def to_Dec Decimal(self,0,'0') end |
#to_Frac ⇒ Object
296 297 298 |
# File 'lib/m500.rb', line 296 def to_Frac Fraction(self,1) end |
#to_K ⇒ Object
308 309 310 |
# File 'lib/m500.rb', line 308 def to_K Kettenbruch(self.to_Frac) end |
#to_N ⇒ Object
287 288 289 |
# File 'lib/m500.rb', line 287 def to_N self > 0 ? Natural(self) : emptySet end |
#to_N0 ⇒ Object
290 291 292 |
# File 'lib/m500.rb', line 290 def to_N0 self >= 0 ? Counting(self) : emptySet end |
#to_Q ⇒ Object
299 300 301 |
# File 'lib/m500.rb', line 299 def to_Q Quotient(self,1) end |
#to_R ⇒ Object
311 312 313 |
# File 'lib/m500.rb', line 311 def to_R naught end |
#to_sgml ⇒ Object
265 266 267 |
# File 'lib/m500.rb', line 265 def to_sgml "<mn #{sgml_id}class='fixnum'>#{self.to_s}</mn>" end |
#to_Sig ⇒ Object
305 306 307 |
# File 'lib/m500.rb', line 305 def to_Sig Sigma(self.to_Q) end |
#to_Z ⇒ Object
293 294 295 |
# File 'lib/m500.rb', line 293 def to_Z Zahlen(self) end |