NVIDIA/SkillEvaluator / src/skillevaluator/tier3/reference_skills/calculator
calculator
VerifiedEvaluate mathematical expressions and unit conversions. Handles arithmetic, percentages, exponents, and common unit conversions (temperature, distance, weight). No external dependencies.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.2 KB |
| evals/evals.json | config | 1.4 KB |
| scripts/calc.py | script | 6.0 KB |
SKILL.md
View on GitHub---
name: calculator
description: Evaluate mathematical expressions and unit conversions. Handles arithmetic, percentages, exponents, and common unit conversions (temperature, distance, weight). No external dependencies.
compatibility: Python 3.10+, no external dependencies
metadata:
author: SkillEvaluator Maintainers <maintainers@example.com>
---
# Calculator
Evaluate math expressions and perform unit conversions from the command line.
## Purpose
Provide a safe, sandboxed calculator for arithmetic expressions and common
unit conversions without relying on `eval()` or external services.
## Agent Instructions
1. Read this SKILL.md to understand capabilities.
2. Run `scripts/calc.py` with the user's expression or conversion.
3. Return the computed result to the user.
## Examples
### Usage
```bash
# Arithmetic expressions
python scripts/calc.py "2 + 3 * 4"
python scripts/calc.py "(100 - 25) / 3"
python scripts/calc.py "2 ** 10"
# Percentage calculations
python scripts/calc.py "15% of 200"
# Unit conversions
python scripts/calc.py "100 celsius to fahrenheit"
python scripts/calc.py "5 miles to km"
python scripts/calc.py "10 kg to lbs"
```
### Output
A single line with the result, e.g.:
```
Result: 14
```
For conversions:
```
100 celsius = 212.0 fahrenheit
```
## Limitations
- No symbolic algebra (no variables, no equations).
- Only supports basic arithmetic operators: `+`, `-`, `*`, `/`, `**`, `%`, parentheses.
- Unit conversions are limited to: celsius/fahrenheit, miles/km, kg/lbs, meters/feet.
- Arithmetic results are limited to 1000 decimal digits for whole-number math, and to the floating-point range (about 1.8e308) when a division or a decimal number is involved; larger, infinite, or non-real arithmetic results return an error. These limits apply to intermediate values as well as the final result, so an expression with a small final value can still be rejected: `10**1000 - 10**1000` returns `Error: result is too large` because each power has 1001 digits.
## Troubleshooting
| Problem | Fix |
|---------|-----|
| `Invalid expression` | Check for unsupported operators or variables |
| `Unknown conversion` | Use supported units: celsius, fahrenheit, miles, km, kg, lbs, meters, feet |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |