calc
Evaluate exact math expressions while preserving fractions and radicals, and solve or simplify symbolic math, statistics, finance, unit, and date calculations in one multi-step call.
Instructions
Evaluate a math expression exactly: fractions stay fractions (1/3), radicals stay radicals (sqrt(2)). Symbolic: solve/diff/simplify/expand/factor/subs. Built-ins: sum/mean/std/median/quantile, loan_pmt, npv, cagr, discount, markup, convert, unit_convert, normal/option functions (norm_cdf, black_scholes_call), dates. Common composite functions: norm_cdf(x), black_scholes_call(spot,strike,years,rate,vol), npv(rate, flows[, start]), loan_pmt(principal, annualRate, years), unit_convert(value, from, to). Call functions() to list names, help("name") for a signature. N(expr, digits) is numeric evaluation, NOT the normal CDF. For multi-step work use one call with steps:[{name,expr},...]; later steps may reference earlier names. Results include a full-precision decimal; copy it verbatim and never round.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| defs | No | optional custom constant/function definitions | |
| expr | No | final expression, e.g. 1000*(1+0.13) or mean([1,2,3]); optional when steps are given | |
| steps | No | named intermediate steps; later steps can reference earlier names |