* Evaluate an arithmetic operation.
(operator: ArithmeticOperator, left: number, right: number)
| 1149 | * Evaluate an arithmetic operation. |
| 1150 | */ |
| 1151 | function evaluateArithmeticOp(operator: ArithmeticOperator, left: number, right: number): number { |
| 1152 | switch (operator) { |
| 1153 | case "+": |
| 1154 | return left + right; |
| 1155 | case "-": |
| 1156 | return left - right; |
| 1157 | case "*": |
| 1158 | return left * right; |
| 1159 | case "/": |
| 1160 | return left / right; |
| 1161 | case "%": |
| 1162 | return left % right; |
| 1163 | case "^": |
| 1164 | return Math.pow(left, right); |
| 1165 | } |
| 1166 | } |
| 1167 | |
| 1168 | /** |
| 1169 | * Stringify a condition value reference for display purposes. |
no outgoing calls
no test coverage detected