MCPcopy Create free account
hub / github.com/codemix/graph / evaluateArithmeticOp

Function evaluateArithmeticOp

packages/graph/src/Steps.ts:1151–1166  ·  view source on GitHub ↗

* Evaluate an arithmetic operation.

(operator: ArithmeticOperator, left: number, right: number)

Source from the content-addressed store, hash-verified

1149 * Evaluate an arithmetic operation.
1150 */
1151function 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.

Callers 1

resolveConditionValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected