跳到正文
cccskills
免费在 GitHub 公开

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.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md1.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

OperationSymbolExample
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 Rootsqrt() (bc)sqrt(16) = 4

Notes

  • Use scale=N in bc to set decimal precision (default is 0, integer only)
  • For floating-point division, always set scale in bc

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use when building, scaffolding, modifying, debugging, converting, or verifying Apache Flink Agents applications, including Flink Agents YAML, Workflow Agent, ReAct Agent, Actions, Resources, MCP servers, vector stores, runtime skills, Python, or Java. Do not use for ordinary Flink jobs that do not use Flink Agents.

中文简介正在准备中。当前显示原文说明。

apache/flink-agents4702026年10月17日 更新

Tell a joke about cat.

中文简介正在准备中。当前显示原文说明。

apache/flink-agents4702026年10月17日 更新

Calculate mathematical expressions using shell commands. Use when the user asks to perform arithmetic calculations like addition, subtraction, multiplication, division, or powers.

中文简介正在准备中。当前显示原文说明。

apache/flink-agents4702026年10月17日 更新

查看 apache 的全部技能

报告此技能的问题