calculate
Safely evaluate mathematical expressions with arithmetic, powers, roots, trigonometry, logarithms, and named variables.
Instructions
Evaluate a mathematical expression safely. Supports: +, -, *, /, ^ (power), % (modulo), sqrt(), abs(), floor(), ceil(), round(), log() (base 10), ln() (natural), sin(), cos(), tan(), min(), max(), pow(), pi, e. Supports named variables.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variables | No | Optional named variables, e.g. {"x": 5, "y": 10} | |
| expression | Yes | The math expression to evaluate, e.g. "2 * (3 + 4) ^ 2" |