name: calculator description: "Perform mathematical calculations and expressions. Use when: user needs to calculate numbers, percentages, or evaluate math expressions. Supports basic arithmetic, advanced functions, and variable storage." metadata: { "openclaw": { "emoji": "๐งฎ" } }
Calculator Skill
Perform mathematical calculations with Python expressions.
When to Use
โ USE this skill when:
- "Calculate 15% of 200"
- "What's 2 + 3 * 4?"
- "Compute sqrt(144)"
- "Convert 100 USD to EUR"
- Any math expression evaluation
When NOT to Use
โ DON'T use this skill when:
- Complex data analysis โ use pandas/numpy directly
- Graphing/plotting โ use matplotlib
- Symbolic math โ use Wolfram Alpha
- Statistical analysis โ use scipy
Commands
Basic Calculation
python3 -c "print(2 + 3 * 4)"
# Output: 14
Percentage
python3 -c "print(200 * 0.15)"
# Output: 30.0
Advanced Functions
# Square root
python3 -c "import math; print(math.sqrt(144))"
# Power
python3 -c "print(2 ** 10)"
# Trigonometry
python3 -c "import math; print(math.sin(math.pi/2))"
With Variables
python3 -c "
x = 10
y = 20
print(f'Sum: {x + y}')
print(f'Product: {x * y}')
"
Available Functions
abs(x)โ Absolute valueround(x, n)โ Round to n decimalspow(x, y)โ x to the power of ymin(a, b, ...)โ Minimum valuemax(a, b, ...)โ Maximum valuesum([...])โ Sum of values
Math Module
python3 -c "import math; print(dir(math))"
math.sqrt(x)โ Square rootmath.sin/cos/tan(x)โ Trigonometrymath.log(x), math.log10(x)โ Logarithmsmath.floor(x), math.ceil(x)โ Roundingmath.pi, math.eโ Constants
Quick Responses
"Calculate 15% of 200"
python3 -c "print(f'15% of 200 = {200 * 0.15}')"
"What's 2^10?"
python3 -c "print(f'2^10 = {2 ** 10}')"
"Square root of 144"
python3 -c "import math; print(f'โ144 = {math.sqrt(144)}')"