Skip to content
Snippets Groups Projects
Commit 66e4b804 authored by Niklas Hannekotte's avatar Niklas Hannekotte
Browse files
parents 78db9fac 23b5a305
No related branches found
No related tags found
No related merge requests found
......@@ -7,9 +7,14 @@
int plus( int a, int b) { return a + b; }
int minus( int a, int b) { return a - b; }
int multiply(int a, int b) { return a * b; }
int divide( int a, int b) { return a / b; }
int power( int a, int b) { return std::pow(a, b); }
int modulo( int a, int b) { return a % b; }
int divide( int a, int b) {
if(b == 0) {
throw std::domain_error("Division by 0.");
}
return a / b;
}
int pop_stack(auto &stack) {
const auto ret{stack.top()};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment