Sha256: ca603ff7c4f9e66976c00cb625ca31e79fa7ac6f3c2fb238885e168d2df41841

Contents?: true

Size: 360 Bytes

Versions: 27

Compression:

Stored size: 360 Bytes

Contents

unless Numeric.method_defined? :neg?
  class Numeric
    # Checks whether a number is negative.
    #
    # @return [Boolean] true is the number is negative, false otherwise
    #
    # @example
    #   5.neg? #=> false
    #
    # @example
    #   -0.5.neg? #=> true
    #
    # @example
    #   0.neg? #=> false
    def neg?
      self < 0
    end
  end
end

Version data entries

27 entries across 24 versions & 6 rubygems

Version Path
powerpack-0.1.3 lib/powerpack/numeric/neg.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/lib/powerpack/numeric/neg.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/lib/powerpack/numeric/neg.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/lib/powerpack/numeric/neg.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/lib/powerpack/numeric/neg.rb
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/lib/powerpack/numeric/neg.rb
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.1/lib/powerpack/numeric/neg.rb
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.1/lib/powerpack/numeric/neg.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/powerpack-0.1.2/lib/powerpack/numeric/neg.rb
powerpack-0.1.2 lib/powerpack/numeric/neg.rb
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/powerpack-0.1.1/lib/powerpack/numeric/neg.rb
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/powerpack-0.1.1/lib/powerpack/numeric/neg.rb
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/powerpack-0.1.1/lib/powerpack/numeric/neg.rb
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/powerpack-0.1.1/lib/powerpack/numeric/neg.rb
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/powerpack-0.1.1/lib/powerpack/numeric/neg.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/powerpack-0.1.1/lib/powerpack/numeric/neg.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/powerpack-0.1.1/lib/powerpack/numeric/neg.rb
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/numeric/neg.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/numeric/neg.rb
powerpack-0.1.1 lib/powerpack/numeric/neg.rb