Mathematical calculation skill for computing arithmetic expressions, trigonometry, logarithms, and complex math. Use EXCLUSIVELY for math calculations: sin, cos, tan, sqrt, log, exponents, etc.
A specialized mathematical calculator skill for computing arithmetic expressions, trigonometric functions, logarithms, and advanced math operations.
This skill is designed EXCLUSIVELY for mathematical calculations. Use it when:
5 + 310 - 46 * 720 / 4sin(x) - Sine of x (x in radians)cos(x) - Cosine of x (x in radians)tan(x) - Tangent of x (x in radians)radians(x) - Convert degrees to radiansdegrees(x) - Convert radians to degrees2 ** 8 (2 to the power of 8)sqrt(16)log(100), log10(100)abs(-5)pi (3.14159...)e (2.71828...)For a complete list of all available functions, see references/functions.md.
python scripts/calculate.py "expression"
python scripts/calculate.py "sin(radians(30))"
# Result: 0.5
python scripts/calculate.py "cos(0)"
# Result: 1.0
python scripts/calculate.py "tan(radians(45))"
# Result: 1.0
python scripts/calculate.py "125 + 237"
# Result: 362
python scripts/calculate.py "2**10 / 4"
# Result: 256.0
For more detailed examples across different domains, see references/examples.md.
The script handles common mathematical errors:
The script uses Python's restricted eval() to safely evaluate mathematical expressions without executing arbitrary code. Only mathematical operations are allowed.