Class: Numeric

Inherits:
Object show all
Defined in:
lib/el4r/el4r-sub.rb,
lib/el4r/el4r-sub.rb

Overview

dump

Instance Method Summary collapse

Instance Method Details

#dumpObject



941
# File 'lib/el4r/el4r-sub.rb', line 941

def dump() self end

#nonzeroObject

If self is negative, returns 0



91
92
93
# File 'lib/el4r/el4r-sub.rb', line 91

def nonzero
  [self, 0].max
end

#signObject

1 : self >=0 / -1 : self < 0



86
87
88
# File 'lib/el4r/el4r-sub.rb', line 86

def sign
  if self >= 0 then 1 else -1 end
end