Provides Basic functions for various operations.
More...
#include <calculator.h>
|
| static double | add (double a, double b) |
| |
| static double | subtract (double a, double b) |
| |
| static double | multiply (double a, double b) |
| |
| static double | divide (double a, double b) |
| |
Provides Basic functions for various operations.
◆ add()
| double Calculator::add |
( |
double |
a, |
|
|
double |
b |
|
) |
| |
|
static |
Adds two numbers.
- Parameters
-
| a | First operand. |
| b | Second operand. |
- Returns
- The sum of a and b.
◆ divide()
| double Calculator::divide |
( |
double |
a, |
|
|
double |
b |
|
) |
| |
|
static |
Divides the first number by the second. Throws std::invalid_argument if the second number is zero.
- Parameters
-
- Returns
- The result of a / b.
- Exceptions
-
| std::invalid_argument | If b is zero. |
◆ multiply()
| double Calculator::multiply |
( |
double |
a, |
|
|
double |
b |
|
) |
| |
|
static |
Multiplies two numbers.
- Parameters
-
| a | First operand. |
| b | Second operand. |
- Returns
- The product of a and b.
◆ subtract()
| double Calculator::subtract |
( |
double |
a, |
|
|
double |
b |
|
) |
| |
|
static |
Subtracts the second number from the first.
- Parameters
-
- Returns
- The result of a - b.
The documentation for this class was generated from the following files: