Lightweight probabilistic calculator that lets you type ranges (with ~) and arithmetic to see exact bounds plus simulated outcomes and a text histogram.
It also supports currency expressions with step-by-step simplification, e.g.:
120usd + 50eur to pln
Notes:
to <currency>converts the expression result to the target currency.- Trailing arithmetic after conversion is supported (
to pln * 20 * 12). - Web app fetches daily FX rates (once per local day) from Frankfurter/ECB for 25 major currencies (EUR base + 24 symbols).
- Supported symbols in daily feed:
EUR, USD, GBP, JPY, CHF, CAD, AUD, NZD, SEK, NOK, DKK, PLN, CZK, HUF, RON, TRY, CNY, HKD, SGD, KRW, INR, MXN, BRL, ZAR, AED. - If live fetch fails, the app falls back to a local EUR/PLN snapshot (
4.22). - Rates can still be overridden programmatically with
evaluateExpressionWithSteps(..., { currencyRates }).
Deployed at: https://calc.pythonic.ninja
- Install prerequisites:
node(v18+ fornode:test) andpython3for the simple dev server. - Run
make devthen openhttp://localhost:8000/web/(override port withDEV_PORT=9000 make dev). - Run
make testto execute the Node unit tests.
core/calc-core.js— single source of calculator logic used by web, Raycast, and tests.core/tests/—node:testsuite covering tokenizer, unary minus, precedence, and range evaluation.web/— static site (Tailwind UI + browser controller).raycast-extension/— Raycast command code and manifest.Makefile— quick commands for local dev and tests.
flowchart TD
A[User Input] --> B[tokenize]
B --> C[shuntingYard to RPN]
C --> D[evalRpn UncertainValue]
D --> E[formatNumber getQuantiles generateTextHistogram]
E --> F[DOM render web/main.js browser handlers]
subgraph Tests
B
C
D
end
make dev— serve the app viapython3 -m http.server $(DEV_PORT)(defaults to 8000).make test— run the Node test suite (node --test core/tests/*.test.js).