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

freakynit1 pts0 comments

GitHub - freakynit/llm-calc: Give your agents a calculator CLI to help them perform calculations accurately. · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

freakynit

llm-calc

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>5 Commits<br>5 Commits

.github/workflows

.github/workflows

.gitignore

.gitignore

README.md

README.md

go.mod

go.mod

main.go

main.go

main_test.go

main_test.go

View all files

Repository files navigation

llm-calc

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

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

On macOS, unsigned downloaded binaries can be blocked by Gatekeeper with a<br>message that the file cannot be opened. After extracting the release archive,<br>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<br>llm-calc-1.0.0-darwin-amd64 on Intel Macs.

On Windows, if SmartScreen or PowerShell reports that the downloaded file is<br>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<br>your shell still reports permission denied after extracting, make it<br>executable:

chmod +x ./llm-calc-1.0.0-darwin-arm64

Build

git clone https://github.com/freakynit/llm-calc<br>cd llm-calc<br>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 .<br>GOOS=darwin GOARCH=arm64 go build -o dist/llm-calc-darwin-arm64 .<br>GOOS=windows GOARCH=amd64 go build -o dist/llm-calc-windows-amd64.exe .

Usage

llm-calc "2 * sin(pi / 4) ^ 2"<br>llm-calc "sqrt(81) + abs(-4)"<br>llm-calc "cos(rad(60))"<br>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"

Supported Operations

Operators:

+ - * / % ^ ! parentheses

Constants:

pi e tau phi

Functions:

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

Notes:

Trigonometric functions use radians.

Use rad(degrees) and deg(radians) for angle conversion.

log and log10 are base-10 logarithms. ln is the natural logarithm.

^ is right-associative, so 2^3^2 means 2^(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.

About

Give your agents a calculator CLI to help them perform calculations accurately.

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

stars

Watchers

watching

Forks

forks

Report repository

Releases

llm-calc 1.0.0

Latest

Jul 7, 2026

Packages

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

Go<br>100.0%

You can’t perform that action at this time.

calc agents reload build amd64 calculator

Related Articles