Skip to main content

calculator-utils

Performs basic arithmetic calculations including addition, subtraction, multiplication, and division. Use when the user needs to calculate numbers, perform math operations, or compute arithmetic expressions.

来源信息

仓库
thangchung/agent-engineering-experiment
最近来源活动
2025年12月24日 13:29
检测到的 SKILL.md 语言
英语
星标
27
分支
6

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
calculator-utils
description
Performs basic arithmetic calculations including addition, subtraction, multiplication, and division. Use when the user needs to calculate numbers, perform math operations, or compute arithmetic expressions.
license
MIT
metadata
{"author":"ai-labs","version":"1.0"}
# Calculator Utilities A basic calculator utility that provides fundamental arithmetic operations via a Python script. ## How to Use Run the calculator script with an operation and numbers: ```bash python scripts/calculator.py <operation> <numbers...> ``` ## Operations ### Add Adds all numbers together. ```bash python scripts/calculator.py add 5 3 # Output: 8 python scripts/calculator.py add 10 20 30 # Output: 60 ``` ### Subtract Subtracts all subsequent numbers from the first number. ```bash python scripts/calculator.py subtract 10 4 # Output: 6 python scripts/calculator.py subtract 100 25 15 # Output: 60 ``` ### Multiply Multiplies all numbers together. ```bash python scripts/calculator.py multiply 6 7 # Output: 42 python scripts/calculator.py multiply 2 3 4 # Output: 24 ``` ### Divide Divides the first number by all subsequent numbers. ```bash python scripts/calculator.py divide 20 4 # Output: 5.0 python scripts/calculator.py divide 100 2 5 # Output: 10.0 ``` ## Error Handling - **Division by zero**: Returns an error message - **Invalid input**: Non-numeric values will show an error - **Missing arguments**: Shows usage instructions ## Examples ```bash # Simple addition python scripts/calculator.py add 100 50 # Output: 150 # Chain subtraction python scripts/calculator.py subtract 1000 250 150 100 # Output: 500 # Multiply decimals python scripts/calculator.py multiply 3.14 2 # Output: 6.28 # Division with decimals python scripts/calculator.py divide 22 7 # Output: 3.142857142857143 ```
在 GitHub 查看