{"slug": "show-hn-a-calculator-cli-to-help-your-agents-perform-calculations-accurately", "title": "Show HN: A calculator CLI to help your agents perform calculations accurately", "summary": "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.", "body_md": "`llm-calc`\n\nis a small dependency-free command line calculator intended for LLM agents and scripts. It evaluates common scientific-calculator operations with deterministic `float64`\n\nmath, so agents can delegate arithmetic instead of guessing.\n\nDownload pre-built binaries from releases, or, build locally as documented below.\n\nOn 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:\n\n```\nxattr -d com.apple.quarantine ./llm-calc-1.0.0-darwin-arm64\n```\n\nUse the actual extracted binary name for your platform, for example\n`llm-calc-1.0.0-darwin-amd64`\n\non Intel Macs.\n\nOn Windows, if SmartScreen or PowerShell reports that the downloaded file is\nblocked, unblock the extracted `.exe`\n\n:\n\n```\nUnblock-File .\\llm-calc-1.0.0-windows-amd64.exe\n```\n\nThe release archives preserve executable permissions on macOS and Linux. If\nyour shell still reports `permission denied`\n\nafter extracting, make it\nexecutable:\n\n```\nchmod +x ./llm-calc-1.0.0-darwin-arm64\ngit clone https://github.com/freakynit/llm-calc\ncd llm-calc\ngo build -o llm-calc .\n```\n\nDrop the resulting binary somewhere on `PATH`\n\n.\n\nCross-compile examples:\n\n```\nGOOS=linux GOARCH=amd64 go build -o dist/llm-calc-linux-amd64 .\nGOOS=darwin GOARCH=arm64 go build -o dist/llm-calc-darwin-arm64 .\nGOOS=windows GOARCH=amd64 go build -o dist/llm-calc-windows-amd64.exe .\nllm-calc \"2 * sin(pi / 4) ^ 2\"\nllm-calc \"sqrt(81) + abs(-4)\"\nllm-calc \"cos(rad(60))\"\nllm-calc \"-2^2\"\n```\n\nAlways pass exactly one quoted expression. This keeps the interface predictable for LLM agents and avoids shell parsing surprises.\n\nSet output precision:\n\n```\nllm-calc -precision 16 \"1 / 3\"\n```\n\nOperators:\n\n```\n+  -  *  /  %  ^  !  parentheses\n```\n\nConstants:\n\n```\npi  e  tau  phi\n```\n\nFunctions:\n\n```\nabs acos asin atan cbrt ceil cos deg exp fact floor hypot ln log log10\nmax min mod pow rad round sin sqrt tan\n```\n\nNotes:\n\n- Trigonometric functions use radians.\n- Use\n`rad(degrees)`\n\nand`deg(radians)`\n\nfor angle conversion. `log`\n\nand`log10`\n\nare base-10 logarithms.`ln`\n\nis the natural logarithm.`^`\n\nis right-associative, so`2^3^2`\n\nmeans`2^(3^2)`\n\n.- Factorial only accepts non-negative integers up to\n`170`\n\n. - Non-finite results, division by zero, and malformed expressions return a non-zero exit code.", "url": "https://wpnews.pro/news/show-hn-a-calculator-cli-to-help-your-agents-perform-calculations-accurately", "canonical_source": "https://github.com/freakynit/llm-calc", "published_at": "2026-07-07 09:39:35+00:00", "updated_at": "2026-07-07 10:00:16.880261+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "large-language-models", "artificial-intelligence"], "entities": ["llm-calc", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/show-hn-a-calculator-cli-to-help-your-agents-perform-calculations-accurately", "markdown": "https://wpnews.pro/news/show-hn-a-calculator-cli-to-help-your-agents-perform-calculations-accurately.md", "text": "https://wpnews.pro/news/show-hn-a-calculator-cli-to-help-your-agents-perform-calculations-accurately.txt", "jsonld": "https://wpnews.pro/news/show-hn-a-calculator-cli-to-help-your-agents-perform-calculations-accurately.jsonld"}}