cd /news/developer-tools/show-hn-a-calculator-cli-to-help-you… · home topics developer-tools article
[ARTICLE · art-49205] src=github.com ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Show HN: A calculator CLI to help your agents perform calculations accurately

A developer released llm-calc, a dependency-free command-line calculator designed for LLM agents to perform accurate arithmetic using deterministic float64 math. The tool supports scientific operations, trigonometric functions, and configurable precision, helping agents avoid calculation errors.

read2 min views6 publishedJul 7, 2026
Show HN: A calculator CLI to help your agents perform calculations accurately
Image: source

llm-calc

is a small dependency-free command line calculator intended for LLM agents and scripts. It evaluates common scientific-calculator operations with deterministic float64

math, so agents can delegate arithmetic instead of guessing.

Download pre-built binaries from releases, or, build locally as documented below.

On macOS, unsigned downloaded binaries can be blocked by Gatekeeper with a message that the file cannot be opened. After extracting the release archive, remove the quarantine flag:

xattr -d com.apple.quarantine ./llm-calc-1.0.0-darwin-arm64

Use the actual extracted binary name for your platform, for example llm-calc-1.0.0-darwin-amd64

on Intel Macs.

On Windows, if SmartScreen or PowerShell reports that the downloaded file is blocked, unblock the extracted .exe

:

Unblock-File .\llm-calc-1.0.0-windows-amd64.exe

The release archives preserve executable permissions on macOS and Linux. If your shell still reports permission denied

after extracting, make it executable:

chmod +x ./llm-calc-1.0.0-darwin-arm64
git clone https://github.com/freakynit/llm-calc
cd llm-calc
go build -o llm-calc .

Drop the resulting binary somewhere on PATH

.

Cross-compile examples:

GOOS=linux GOARCH=amd64 go build -o dist/llm-calc-linux-amd64 .
GOOS=darwin GOARCH=arm64 go build -o dist/llm-calc-darwin-arm64 .
GOOS=windows GOARCH=amd64 go build -o dist/llm-calc-windows-amd64.exe .
llm-calc "2 * sin(pi / 4) ^ 2"
llm-calc "sqrt(81) + abs(-4)"
llm-calc "cos(rad(60))"
llm-calc "-2^2"

Always pass exactly one quoted expression. This keeps the interface predictable for LLM agents and avoids shell parsing surprises.

Set output precision:

llm-calc -precision 16 "1 / 3"

Operators:

+  -  *  /  %  ^  !  parentheses

Constants:

pi  e  tau  phi

Functions:

abs acos asin atan cbrt ceil cos deg exp fact floor hypot ln log log10
max min mod pow rad round sin sqrt tan

Notes:

  • Trigonometric functions use radians.
  • Use rad(degrees)

anddeg(radians)

for angle conversion. log

andlog10

are base-10 logarithms.ln

is the natural logarithm.^

is right-associative, so2^3^2

means2^(3^2)

.- Factorial only accepts non-negative integers up to 170

. - Non-finite results, division by zero, and malformed expressions return a non-zero exit code.

── more in #developer-tools 4 stories · sorted by recency
── more on @llm-calc 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-a-calculator…] indexed:0 read:2min 2026-07-07 ·