| name | math-calculator |
| description | Calculate simple mathematical expressions using shell commands. Use when the user asks to perform arithmetic calculations like addition, subtraction, multiplication, division, or more complex math expressions. |
| license | Apache-2.0 |
| compatibility | Requires bash with bc (basic calculator) |
Math Calculator Skill
This skill provides the ability to calculate mathematical expressions using shell commands.
When to Use
Use this skill when:
- Performing arithmetic calculations (add, subtract, multiply, divide)
- Evaluating mathematical expressions with parentheses
- Computing percentages or powers
- Any numeric computation requested by the user
Methods
Using bc (Basic Calculator)
The bc command is a powerful calculator that supports:
- Basic arithmetic:
+, -, *, /
- Power:
^
- Parentheses for grouping
- Scale for decimal precision
Example:
echo "2 + 3 * 4" | bc
| bc
| bc