instance method
negative?
Ruby on Rails 5.2.8.1
Since v5.2.8.1 Last seen in v5.2.8.1Signature
negative?()
Returns true if the number is negative.
-1.negative? # => true 0.negative? # => false 1.negative? # => false
Source
# File activesupport/lib/active_support/core_ext/numeric/inquiry.rb, line 19
def negative?
self < 0
end
Defined in activesupport/lib/active_support/core_ext/numeric/inquiry.rb line 19
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Numeric