Class Numeric
In: lib/powerpack/numeric/scale.rb
lib/powerpack/numeric/pos.rb
lib/powerpack/numeric/neg.rb
Parent: Object

Methods

billion   hundred   million   neg?   pos?   quadrillion   thousand   trillion  

Constants

HUNDRED = 10 ** 2
THOUSAND = 10 ** 3
MILLION = 10 ** 6
BILLION = 10 ** 9
TRILLION = 10 ** 12
QUADRILLION = 10 ** 15

Public Instance methods

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

Checks whether a number is positive.

@return [Boolean] true is the number is positive, false otherwise

@example

  5.pos? #=> true

@example

  -0.5.pos? #=> false

@example

  0.pos? #=> false

[Validate]