
Calculator
A straightforward arbitrary-precision calculator that handles the math expressions you throw at it without floating-point nonsense. Built on big.js, so 0.1 + 0.2 actually equals 0.3 like it should. Supports the standard operators plus exponents (right-associative, integers only), respects precedence, and handles parentheses correctly. You call it from the command line with an expression string and get a result back. The limitation list is honest: no trig functions, no variables, no modulo. It does one thing well, which is evaluate basic arithmetic precisely. Good for when you need Claude to crunch numbers in financial contexts or anywhere decimal accuracy matters more than scientific computing features.
- GitHub stars
- 534
- last updated
- Apr 29, 2026
Install
$ npx -y skills add code-and-sorts/awesome-copilot-agents --skill calculator --agent claude-codeInstalls into .claude/skills of the current project.
Files
Calculator
Evaluate arithmetic expressions with arbitrary-precision decimal math using big.js.
When to Use
- User asks to calculate or evaluate a math expression
- Precise decimal arithmetic is needed (avoids floating-point errors like
0.1 + 0.2 = 0.30000000000000004) - Expressions involve parentheses, operator precedence, or exponents
Supported Operations
| Operator | Description | Precedence |
|---|---|---|
+ | Addition | 1 |
- | Subtraction | 1 |
* | Multiplication | 2 |
/ | Division | 2 |
^ | Exponent (right-associative) | 3 |
() | Parentheses | Highest |
Usage
cd scripts
npm ci || npm install
npm run build
npm run calculate "<expression>"
Examples
| Input | Output |
|---|---|
"3 + 2" | 5 |
"10 / 4" | 2.5 |
"2 ^ 10" | 1024 |
"(2 + 3) * 4" | 20 |
"1 + 4.5 * (3-6) / 5" | -1.7 |
"-5 + 3" | -2 |
"2 ^ 3 ^ 2" | 512 (right-associative: 2^9) |
Edge Cases
Sponsors
Details
- Repository
- github.com/code-and-sorts/awesome-copilot-agents
- Category
- AI & Agent Building
- License
- CC0-1.0
- First seen
- Jun 11, 2026