Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/casual_support/numeric/sign.rb

Instance Method Summary collapse

Instance Method Details

#signInteger

Returns the sign of the number expressed as -1, 0, or 1.

Examples:

-4.sign  # == -1
0.sign   # == 0
16.sign  # == 1

Returns:



11
12
13
# File 'lib/casual_support/numeric/sign.rb', line 11

def sign
  self <=> 0
end