math-calculator
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
- 最近更新
- 2026-11-13
- Stars
- ★ 491
- Forks
- 184
01 前言 Front Matter
- name
- math-calculator
- license
- Apache-2.0
- 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.
- compatibility
- Requires bash with bc (basic calculator)
02 资源文件 1
- 参考文档agents/openai.yaml113 B
03 SKILL.md 正文
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
# Output: 14
echo "scale=2; 10 / 3" | bc
# Output: 3.33
echo "(2 + 3) * 4" | bc
# Output: 20
Supported Operations
| Operation | Symbol | Example |
|---|---|---|
| Addition | + |
5 + 3 = 8 |
| Subtraction | - |
10 - 4 = 6 |
| Multiplication | * |
6 * 7 = 42 |
| Division | / |
15 / 3 = 5 |
| Power | ^ (bc) or ** (Python) |
2 ^ 3 = 8 |
| Modulo | % |
17 % 5 = 2 |
| Square Root | sqrt() (bc) |
sqrt(16) = 4 |
Notes
- Use
scale=Ninbcto set decimal precision (default is 0, integer only) - For floating-point division, always set
scaleinbc
04 同仓库更多 Skills
nano-banana-pro
Generate/edit images with Nano Banana Pro (Gemini 3 Pro Image). Use for image create/modify requests incl. edits. Supports text-to-image + image-to-image; 1K/2K/4K; use --input-image.
github
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
nano-banana-pro
Generate/edit images with Nano Banana Pro (Gemini 3 Pro Image). Use for image create/modify requests incl. edits. Supports text-to-image + image-to-image; 1K/2K/4K; use --input-image.
github
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
math-calculator
Calculate mathematical expressions using shell commands. Use when the user asks to perform arithmetic calculations like addition, subtraction, multiplication, division, or powers.
math-calculator
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.