Class: Numeric
- Inherits:
-
Object
show all
- Includes:
- SGML
- Defined in:
- lib/m500.rb
Instance Method Summary
collapse
Methods included from SGML
#tog_sgml_id
Instance Method Details
#coerce(other) ⇒ Object
316
317
318
319
320
321
322
|
# File 'lib/m500.rb', line 316
def coerce(other)
if Natural === other or Counting === other or Zahlen === other or Quotient === other or Fraction === other
[other.to_i,self]
else
super
end
end
|
#irrational? ⇒ Boolean
310
311
312
|
# File 'lib/m500.rb', line 310
def irrational?
false
end
|
#rational? ⇒ Boolean
313
314
315
|
# File 'lib/m500.rb', line 313
def rational?
true
end
|
#sgml_id ⇒ Object
275
276
277
278
279
|
# File 'lib/m500.rb', line 275
def sgml_id
ret = ""
@idsgml ? ret = "id='#{self.class.to_s.downcase}#{self.object_id}' " : ret = ""
ret
end
|
#to_Dec ⇒ Object
298
299
300
|
# File 'lib/m500.rb', line 298
def to_Dec
self
end
|
#to_Frac ⇒ Object
292
293
294
|
# File 'lib/m500.rb', line 292
def to_Frac
self
end
|
#to_K ⇒ Object
304
305
306
|
# File 'lib/m500.rb', line 304
def to_K
self
end
|
#to_N ⇒ Object
283
284
285
|
# File 'lib/m500.rb', line 283
def to_N
self
end
|
#to_N0 ⇒ Object
286
287
288
|
# File 'lib/m500.rb', line 286
def to_N0
self
end
|
#to_Q ⇒ Object
295
296
297
|
# File 'lib/m500.rb', line 295
def to_Q
self
end
|
#to_R ⇒ Object
307
308
309
|
# File 'lib/m500.rb', line 307
def to_R
self
end
|
#to_sgml ⇒ Object
280
281
282
|
# File 'lib/m500.rb', line 280
def to_sgml
"<mn #{sgml_id}class='numeric'>#{self.to_s}</mn>"
end
|
#to_Sig ⇒ Object
301
302
303
|
# File 'lib/m500.rb', line 301
def to_Sig
self
end
|
#to_Z ⇒ Object
289
290
291
|
# File 'lib/m500.rb', line 289
def to_Z
self
end
|