Repository navigation
v0.2.0
[0.2.0] - 2026-09-24
Added
-
Homebrew formula (
Formula/excalc.rb), installable viabrew tap dblock/excalc-rs https://github.com/dblock/excalc-rs && brew install excalc. Builds from source viacargo install. CI audits/installs/tests the formula on every push/PR via.github/workflows/homebrew.yml;RELEASING.mddocuments updating itsurl/sha256on every release. -
Windows MSI installer, built with cargo-wix from
wix/main.wxs(bundlesexcalc,calc, andexcalc-mcp, with an optional PATH entry)..github/workflows/msi.ymlbuilds it on every push/PR;.github/workflows/release.ymlrebuilds it and attaches it to each published GitHub release. -
calcbinary alias forexcalc(same CLI, shorter name). -
docs/reference documentation, per function category, marked ported (implemented) vs. planned (extracted from the original Pascal source as a porting reference). -
README
### Examplessection covering every ported operator and function, verified against the evaluator bytests/readme_examples.rsso it can't silently drift out of sync. -
CONTRIBUTING.mdwith build/test/PR instructions, replacing the README's## Developmentsection. -
CI: test coverage reported to Coveralls via
cargo llvm-cov, plus a CI status and coverage badge in README. -
Test suite brought to ~99% line coverage: unit tests for every reciprocal/hyperbolic trig function and error path, statistics error paths, evaluator error paths (unknown variable, factorial overflow, log/root domain errors), lexer edge cases (decimals, scientific notation), parser error paths, and a new
tests/cli.rsexercising the compiled binary end-to-end. The 3 remaining uncovered lines aretan/sec/sechdivision-by-zero guards that are mathematically unreachable for any real input. -
excalc-mcpbinary: an MCP server exposing a singleevaluatetool over stdio (via rmcp), so AI agents that speak MCP can call the evaluator directly instead of shelling out to the CLI. Built and installed by default via themcpCargo feature (opt out withcargo install excalc --no-default-featuresfor a CLI-only install). Covered bytests/mcp.rs, including a test that keeps the README's example expression in sync with the real evaluator. README documents one-liners to register it with GitHub Copilot CLI (copilot mcp add) and Claude Code (claude mcp add), plus a worked example combining several functions in one expression. -
General / rounding functions:
abs,frac,intg(alias oftrunc),round(round-half-up),trunc,ceil,floor,random(x)(uniform random number in[0, x], via therandcrate). -
Number theory functions:
gcd,lcm,fib,prime?,moebius,mersenne,perfect,fermat,safeprime,primec,primen,mersennegen,mersgen,genmers,sigma,tau,phi/eind, backed by a deterministic Miller-Rabin primality test (valid for the fullu64range). -
Comparison and logical/bitwise operators:
=,>,<(comparison, returning1/0),xor,xnor,and(&synonym),nand,or,nor(bitwise, operating on operands truncated toi64), plusnot(x),shl(x, y),shr(x, y). Precedence: comparison loosest, then logical-or-family, then logical-and-family, then the existing arithmetic chain. Deviates from the original:=now tests equality instead of assigning a variable, and?(the original's equality test) was dropped since it's no longer needed. -
Advanced / special functions:
gamma,beta,pochhammer,bth,bman,ellipticE,ellipticF(aliasellipticK),ellipticCE,ellipticCK,dilog,dawson,erf,erfc,si,ssi,ci,chi,fresnelC,fresnelS,fresnelF,fresnelG. Most of these are thin wrappers around a generic numeric-integration primitive in the original engine; this port routes them through the same shared adaptive-quadrature engine used by the general-purpose numeric integration functions below (gammakeeps its own fixed-step Riemann sum instead, to match its pre-existing worked example) — seedocs/functions/advanced.md. -
Financial functions:
pv,fv,pmt,npv,rate,cterm,term,sln,syd,ddb,db, and the extended payment-timing-aware variantsirate,nper,paymt,fval,pval,ipaymt,ppaymt. Unlike the advanced/special functions, these are all closed-form (or, forirate, a literal secant-method root find) and don't depend on numeric integration. -
General-purpose numeric integration: named composite quadrature rules
trapezoid(aliasestrapez/trapezoide),simpson,newton,boole,ordersix(aliasordresix),weddle(each over a whole-number sub-interval countn), plus adaptive quadratureint(aliasgauss, refining to a requested tolerance). These are the only functions in the port that take an unevaluated expression and a bare variable as arguments instead of plain numbers, evaluating the expression repeatedly at sample points; seedocs/functions/numeric-integration.md. This closes out every function category originally planned for the port. -
Variables:
name := exprassigns to a variable, visible to later statements in the same input, which can now be a;- or newline-separated sequence of statements (assignments and/or plain expressions); the value of the last statement is the result. Assignment is a statement, not an expression, so it can't be nested or chained (x := y := 5), keeping it unambiguous with='s equality meaning.pi/eremain reserved and can't be reassigned. Variables don't persist across separatecalcinvocations or MCP tool calls. -
Degree/radian support:
deg(x)/rad(x)convert between radians and degrees, andsind/cosd/tand/asind/acosd/atandare degree-native variants of the six basic circular trig functions. Deliberately stateless/explicit rather than reviving the original's globalCalcModetoggle — seedocs/functions/standard-math.mdandDESIGN.md#angle-units.
Fixed
- Removed dead/unreachable
Token::Minusarm inparser.rs'sparse_primary(unary minus is always handled earlier byparse_unary, so this branch could never execute). - The original's
Ci/Chiformulas reference an undefined variableG(presumably meant to be the Euler-Mascheroni constant), which the generic variable-lookup mechanism silently defaults to0, making the original results meaningless. This port hardcodes the actual Euler-Mascheroni constant instead. docs/functions/advanced.md's placeholder exampleellipticCK(1) → 5.99158934050168was wrong; corrected to1.57079632679490(pi/2), matchingellipticCE(1)since both reduce to the same integral at that boundary.docs/functions/financial.md's draft named the fixed-declining-balance depreciation functionfdb; corrected todb, matching the name actually dispatched in the original engine.