Class: Demalculator::Calc
- Inherits:
-
Object
- Object
- Demalculator::Calc
- Defined in:
- lib/demalculator.rb
Overview
class used for calculations
Class Method Summary collapse
- .add(addend, augend) ⇒ Object
- .multiply(factor, multiplicator) ⇒ Object
- .power(base, exp) ⇒ Object
- .subtract(minuend, subtrahend) ⇒ Object
Class Method Details
.add(addend, augend) ⇒ Object
8 9 10 |
# File 'lib/demalculator.rb', line 8 def self.add(addend, augend) addend + augend end |
.multiply(factor, multiplicator) ⇒ Object
16 17 18 |
# File 'lib/demalculator.rb', line 16 def self.multiply(factor, multiplicator) factor * multiplicator end |
.power(base, exp) ⇒ Object
20 21 22 |
# File 'lib/demalculator.rb', line 20 def self.power(base, exp) base**exp end |
.subtract(minuend, subtrahend) ⇒ Object
12 13 14 |
# File 'lib/demalculator.rb', line 12 def self.subtract(minuend, subtrahend) minuend - subtrahend end |