# Calculate Precise Decimal Expressions

Floating-point math can produce surprising decimal results. This skill evaluates arithmetic expressions with arbitrary-precision decimal handling.

## Install

```bash
npx skillstore add code-and-sorts/calculator
```

## Metadata

- Status: approved
- Slug: code-and-sorts-calculator
- Version: 1.0
- Author version: 1.0
- Skillstore revision: r1
- Version status: invalid
- Tree hash: ea1ab9c81423ff1b00938fc3a594f8b311c176a982d03e0d4af5474df9187127
- Author: Code-and-Sorts
- GitHub username: Code-and-Sorts
- License: MIT
- Repository: https://github.com/Code-and-Sorts/awesome-copilot-agents/tree/main/skills/calculator
- Ref: d11af420e07cd866fe39cfa937efef3223896c06
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: scripts, external\_commands, network
- Quality score: 75
- Public page: https://skillstore.pages.dev/skills/code-and-sorts-calculator
- Manifest: https://skillstore.pages.dev/api/skills/code-and-sorts-calculator/manifest

## Capabilities

- Evaluates expression strings passed through the Node.js runner.
- Supports addition, subtraction, multiplication, division, parentheses, and exponentiation.
- Applies operator precedence and right-associative exponent rules.
- Uses big.js to avoid common decimal floating-point errors.
- Handles negative numbers, nested parentheses, whitespace, and large decimal values.

## Use Cases

- Check precise decimal arithmetic: Verify calculations where binary floating-point rounding would be misleading.
- Validate operational formulas: Calculate budget, ratio, or conversion formulas without leaving the assistant workflow.
- Review homework arithmetic: Confirm arithmetic with parentheses, negative numbers, and exponents.

## Prompt Templates

### Calculate a simple expression

```
Use the calculator skill to evaluate 3.75 + 4.2. Return only the result and a short check.
```

### Check decimal precision

```
Use the calculator skill to evaluate 0.1 + 0.2 + 0.3. Explain why the decimal result is exact.
```

### Evaluate precedence

```
Use the calculator skill to evaluate 1 + 4.5 * (3 - 6) / 5. Show the order of operations briefly.
```

### Compare compound expressions

```
Use the calculator skill to evaluate (2 + 3) * 4 and 2 ^ 3 ^ 2. Report both results and note exponent associativity.
```

## Limitations

- Does not support variables, symbolic algebra, trigonometric functions, modulo, factorial, or bitwise operators.
- Exponents must be integers because the calculation library requires integer powers.
- Very large expressions or exponents may be slow or fail.
- Requires Node.js and dependency setup before the CLI can run.

## Best Practices

- Use explicit parentheses when an expression could be read in more than one way.
- Keep very large exponents small enough for practical runtime.
- Ask for a short verification when the result will be used in a decision.

## Anti Patterns

- Do not use it for symbolic algebra, calculus, or equation solving.
- Do not send untrusted bulk input without length or complexity limits.
- Do not assume it supports functions such as sine, cosine, logarithm, or square root.

## Security Audit

- Audited at: 2026-07-06T07:09:53.028\+00:00
- Summary: The static high-risk alerts are false positives: RegExp.exec\(\) is used for tokenization, not process or Python execution. The markdown backtick and URL findings are documentation examples and a dependency link, and no prompt injection or exfiltration intent was found.

## Stats

- Views: 179
- Downloads: 10
- Favorites: 0
- Popularity score: 0
