You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
310 B
19 lines
310 B
#include "math_functions.h"
|
|
|
|
int add(int a, int b) {
|
|
return a + b;
|
|
}
|
|
|
|
int subtract(int a, int b) {
|
|
return a - b;
|
|
}
|
|
|
|
int multiply(int a, int b) {
|
|
return a * b;
|
|
}
|
|
|
|
double divide(int a, int b) {
|
|
if (b == 0) throw std::invalid_argument("division by zero");
|
|
return static_cast<double>(a) / b;
|
|
}
|