Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/powerpack/numeric/neg.rb,
lib/powerpack/numeric/pos.rb,
lib/powerpack/numeric/scale.rb
Constant Summary collapse
- HUNDRED =
10 ** 2
- THOUSAND =
10 ** 3
- MILLION =
10 ** 6
- BILLION =
10 ** 9
- TRILLION =
10 ** 12
- QUADRILLION =
10 ** 15
Instance Method Summary collapse
- #billion ⇒ Object
- #hundred ⇒ Object
- #million ⇒ Object
-
#neg? ⇒ Boolean
Checks whether a number is negative.
-
#pos? ⇒ Boolean
Checks whether a number is positive.
- #quadrillion ⇒ Object
- #thousand ⇒ Object
- #trillion ⇒ Object
Instance Method Details
#billion ⇒ Object
28 29 30 |
# File 'lib/powerpack/numeric/scale.rb', line 28 def billion self * BILLION end |
#hundred ⇒ Object
10 11 12 |
# File 'lib/powerpack/numeric/scale.rb', line 10 def hundred self * HUNDRED end |
#million ⇒ Object
22 23 24 |
# File 'lib/powerpack/numeric/scale.rb', line 22 def million self * MILLION end |
#neg? ⇒ Boolean
Checks whether a number is negative.
15 16 17 |
# File 'lib/powerpack/numeric/neg.rb', line 15 def neg? self < 0 end |
#pos? ⇒ Boolean
Checks whether a number is positive.
15 16 17 |
# File 'lib/powerpack/numeric/pos.rb', line 15 def pos? self > 0 end |
#quadrillion ⇒ Object
40 41 42 |
# File 'lib/powerpack/numeric/scale.rb', line 40 def quadrillion self * QUADRILLION end |
#thousand ⇒ Object
16 17 18 |
# File 'lib/powerpack/numeric/scale.rb', line 16 def thousand self * THOUSAND end |
#trillion ⇒ Object
34 35 36 |
# File 'lib/powerpack/numeric/scale.rb', line 34 def trillion self * TRILLION end |