Add * and / support to evaluator

This commit is contained in:
2024-10-24 20:08:01 +01:00
parent 9932aa7ef1
commit 7b0f94ce98
2 changed files with 44 additions and 0 deletions

View File

@@ -11,6 +11,10 @@ int evaluate(const expression_t *expression)
return x + y;
case OPERATOR_SUBTRACT:
return x - y;
case OPERATOR_MULTIPLY:
return x * y;
case OPERATOR_DIVIDE:
return x / y;
default:
return -1;
}