calculator

Perform mathematical calculations and unit conversions. Use when the user needs to calculate expressions, convert units (length, mass, temperature, volume, area, time), or solve math problems. Supports basic arithmetic (+, -, *, /, %, ^), scientific functions (sin, cos, tan, log, sqrt, etc.), and common unit conversions.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "calculator" with this command: npx skills add wushengbing/wentianxe-calculator

Calculator Skill

Perform mathematical calculations and unit conversions.

Usage

Calculate Expressions

python3 scripts/calculator.py calc "<expression>"

Supported operations:

  • Basic arithmetic: +, -, *, /, %, ^ (or **)
  • Parentheses for grouping: (2 + 3) * 4
  • Percentage: 50%0.5, 100 + 10%110

Math functions:

  • Trigonometric: sin(), cos(), tan(), asin(), acos(), atan()
  • Hyperbolic: sinh(), cosh(), tanh()
  • Logarithms: log() (natural), log10(), log2(), ln()
  • Powers/roots: sqrt(), pow(), exp()
  • Rounding: round(), floor(), ceil()
  • Other: abs(), max(), min(), factorial(), gcd()
  • Constants: pi, e
  • Angle conversion: degrees(), radians()

Examples:

python3 scripts/calculator.py calc "2 + 2"
python3 scripts/calculator.py calc "sin(pi/2)"
python3 scripts/calculator.py calc "sqrt(16) + log(10)"
python3 scripts/calculator.py calc "(100 - 20) * 1.5"
python3 scripts/calculator.py calc "2^10"
python3 scripts/calculator.py calc "50% of 200"

Unit Conversions

python3 scripts/calculator.py convert <value> <from_unit> <to_unit>

Supported categories:

CategoryUnits
Lengthm, km, cm, mm, mi, yd, ft, in, nm
Massg, kg, mg, lb, oz, t/ton
Volumel, ml, gal, qt, pt, cup, fl oz, tbsp, tsp
Aream², km², cm², ha, acre, ft², in²
Times, min, h, d, wk, mo, y
Temperature°C, °F, K

Examples:

python3 scripts/calculator.py convert 100 km miles
python3 scripts/calculator.py convert 70 f c
python3 scripts/calculator.py convert 2.5 kg lb
python3 scripts/calculator.py convert 500 ml cups

Output Format

All commands output JSON:

{"result": 42}
{"result": 3.14159, "category": "length"}
{"error": "Division by zero"}

Error Handling

Common errors and their meanings:

  • Division by zero - Attempted to divide by zero
  • Invalid expression syntax - Malformed expression
  • Unknown function or variable - Used unsupported function/variable
  • Unsupported unit conversion - Units not in same category or not recognized

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Zero Api Key Web Search

OpenClaw skill for source-backed web search, page reading, and evidence-aware claim checking. No API keys required by default; optional providers can be enab...

Registry SourceRecently Updated
General

Hk Stock Morning Report

Generate HK stock market morning report (股市晨報) for bank trading desks. Triggers: "生成晨报","股市晨报","今日股市","港股晨報" 推送:微信個人 + 飛書群 | 數據:騰訊財經+stcn.com+格隆匯+實時搜索

Registry SourceRecently Updated
General

忆时

🎋 记忆胶囊系统 - 模拟人类记忆检索 | 自动加载,主动联想记忆

Registry SourceRecently Updated
General

Hit Preview EN

Analyzes English short video scripts for TikTok, YouTube Shorts, and Instagram Reels to predict hit potential and suggest improvements with AI or local fallb...

Registry SourceRecently Updated