Skip to content
Back to skills

Calculate

ASecurity

Compute the value of a math expression. Handles arithmetic, algebra, trig, calculus. Use this instead of LLM arithmetic — calculate is exact and deterministic.

  • 10 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 6, 2026
businessexpress

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 6, 2026

npx -y skills add bdambrosio/Cognitive_workbench --skill calculate --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Calculate?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Calculate
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bdambrosio-calculate/badge)](https://www.skillsdirectory.com/skills/bdambrosio-calculate)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: calculate
description: Compute the value of a math expression. Handles arithmetic, algebra, trig, calculus. Use this instead of LLM arithmetic — calculate is exact and deterministic.
args:
  expression: required string — the math expression, e.g. "2 + 3 * sqrt(7)" or "x**2 - 4 = 0"
  vars: optional string — variable bindings as "name=value, name=value", e.g. "v=20, theta=30, g=9.8"
  precision: optional int (default 10) — decimal places for the result
---

# calculate

Numerically evaluate mathematical expressions via SymPy. Returns the result as a string.

## Supported operations

- **Operators**: `+`, `-`, `*`, `/`, `**`, `%`
- **Constants**: `pi`, `E`
- **Functions**: `sin`, `cos`, `tan`, `asin`, `acos`, `atan` (radians), `sqrt`, `log`, `ln`, `exp`, `abs`, `factorial`
- **Equations**: an expression containing `=` is solved (e.g. `x**2 - 4 = 0` → `-2.0, 2.0`)

All trig functions expect radians.

## Examples

```json
{"thought": "compute the discriminant", "tool": "calculate", "expression": "b**2 - 4*a*c", "vars": "a=1, b=-5, c=6"}
```

```json
{"thought": "projectile range", "tool": "calculate", "expression": "2 * v * sin(theta * pi / 180) / g", "vars": "v=20, theta=30, g=9.8"}
```

```json
{"thought": "roots of a quadratic", "tool": "calculate", "expression": "x**2 - 4 = 0"}
```

Files in this skill

  • Skill.md1.3 KB
  • tool.py5.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.