← 返回
效率工具 中文

Calculator

Accurate mathematical calculations. Use when user needs to compute: (1) Basic arithmetic (+, -, *, /), (2) Powers and roots (^, sqrt), (3) Percentages, (4) T...
精确的数学计算。适用于用户需要计算:(1)基本算术(+、-、*、/),(2)幂和根(^、sqrt),(3)百分比,以及其它计算。
yukin1218
效率工具 clawhub v1.0.1 1 版本 99808.5 Key: 无需
★ 1
Stars
📥 2,065
下载
💾 30
安装
1
版本
#arithmetic#calculator#latest#math

概述

Calculator Skill

Perform accurate mathematical calculations using the calc.py script.

Usage

Run calculations directly with Python:

python3 <skill-path>/scripts/calc.py "<expression>"

Supported Operations

Basic Arithmetic

  • + Addition: 2 + 3 → 5
  • - Subtraction: 10 - 4 → 6
  • Multiplication: 6 7 → 42
  • / Division: 15 / 3 → 5

Powers & Roots

  • ^ or ** Power: 2^10 → 1024
  • sqrt() Square root: sqrt(16) → 4

Percentages

  • 100 * 15% → 15 (15% of 100)
  • 50 + 50 * 10% → 55 (add 10%)

Trigonometry (radians)

  • sin(pi/2) → 1
  • cos(pi) → -1
  • tan(pi/4) → 1

Logarithms

  • log(100) → 2 (base 10)
  • ln(e) → 1 (natural log)

Constants

  • pi → 3.141592653589793
  • e → 2.718281828459045

Other Functions

  • abs(-5) → 5
  • round(3.7) → 4
  • floor(3.9) → 3
  • ceil(3.1) → 4
  • pow(2, 8) → 256

Examples

python3 scripts/calc.py "2 + 3 * 4"        # 14
python3 scripts/calc.py "(2 + 3) * 4"       # 20
python3 scripts/calc.py "sqrt(144)"         # 12
python3 scripts/calc.py "2^8"               # 256
python3 scripts/calc.py "1000 * 5%"         # 50
python3 scripts/calc.py "sin(0)"            # 0
python3 scripts/calc.py "log(1000)"         # 3

Notes

  • Implicit multiplication supported: 2(3) = 2*3
  • Use parentheses for grouping
  • Float results are rounded to 10 decimal places to avoid precision issues

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-29 09:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,802
productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 445 📥 226,232
developer-tools

Blackjack Helper

yukin1218
Blackjack (21点) decision assistant. Provides optimal action recommendations based on player's hand and dealer's upcard:
★ 0 📥 519