Class: Fixnum
- Defined in:
- lib/rational.rb,
lib/builtinME.rb,
lib/builtinME.rb,
lib/rationalME.rb
Instance Method Summary collapse
- #is_alpha_numeric ⇒ Object
-
#quo(other) ⇒ Object
(also: #rdiv)
If Rational is defined, returns a Rational number instead of a Fixnum.
- #to_i ⇒ Object
Methods inherited from Integer
#denominator, #downto, #gcd, #gcdlcm, #integer?, #lcm, #next, #numerator, #size, #succ, #to_r, #upto
Methods inherited from Numeric
#abs, #div, #divmod, #floor, #integer?, #modulo, #nonzero?, #remainder, #zero?
Methods included from Comparable
#<, #<=, #==, #>, #>=, #between?
Instance Method Details
#is_alpha_numeric ⇒ Object
339 340 341 |
# File 'lib/builtinME.rb', line 339 def is_alpha_numeric return (self>=?0 && self<=?9) || (self>=?a && self<=?z) || (self>=?A && self<=?Z) end |
#quo(other) ⇒ Object Also known as: rdiv
If Rational is defined, returns a Rational number instead of a Fixnum.
486 487 488 |
# File 'lib/rationalME.rb', line 486 def quo(other) Rational.new!(self,1) / other end |
#to_i ⇒ Object
473 474 475 |
# File 'lib/builtinME.rb', line 473 def to_i self end |