Class: Fixnum
- Inherits:
-
Object
- Object
- Fixnum
- Defined in:
- lib/kim/fixnum.rb
Instance Method Summary collapse
Instance Method Details
#negative? ⇒ Boolean
11 12 13 |
# File 'lib/kim/fixnum.rb', line 11 def negative? sign == -1 end |
#positive? ⇒ Boolean
7 8 9 |
# File 'lib/kim/fixnum.rb', line 7 def positive? sign == 1 end |
#sign ⇒ Object
2 3 4 5 |
# File 'lib/kim/fixnum.rb', line 2 def sign return 1 if self == 0 self / self.abs end |