calculate
Evaluate arithmetic expressions safely and return numeric results. Supports operators, parentheses, constants, and math functions like sqrt and log without using eval.
Instructions
Safely evaluate an arithmetic expression and return the numeric result.
Supports + - * / // % ** parentheses, the constants pi/e/tau, and common math functions (sqrt, sin, cos, log, factorial, etc.). It does NOT use eval; expressions are parsed and evaluated against a strict whitelist.
Args: expression: e.g. "2 + 2", "sqrt(144)", "(3.5 * 4) ** 2", "log(e)".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes |