math.pow
base to the power exponent from + - * / only, exact by squaring for whole exponents, identical in every language.
pow in TypeScript
1.0.0
py rs ts
16 tests
Apache-2.0
math.exp
e to the power x from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
exp in TypeScript
1.0.1
py rs ts
10 tests
Apache-2.0
math.atan
Arctangent in radians from + - * / only (fdlibm's method), so every language returns the same double.
atan in TypeScript
1.0.1
py rs ts
22 tests
Apache-2.0
math.fractional-power
Raise a positive decimal to a fractional power, (1.199)^(31/365), identically in every language.
fractionalPower in TypeScript
1.0.0
py rs ts
19 tests
Apache-2.0
math.round-div-big
Divide two integers of any size with an explicit rounding mode, on decimal strings, for exact money sums past 2^53.
roundDivBig in TypeScript
1.0.0
py rs ts
21 tests
Apache-2.0
math.rational
Exact fraction arithmetic, always reduced, for rates and ratios that must not drift.
A group of 8: calculateRational, rational, addRational, subtractRational, multiplyRational, divideRational, compareRational, rationalToInteger
2.0.0
py rs ts
86 tests
Apache-2.0
math.percent-change
Percentage change from one value to another, in basis points, with an explicit rounding mode.
percentChange in TypeScript
1.0.0
py rs ts
19 tests
Apache-2.0
math.ln
Natural logarithm from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
ln in TypeScript
1.0.1
py rs ts
11 tests
Apache-2.0
math.big-integer
Exact integer arithmetic of any size, on decimal strings, for powers and products that overflow 64 bits.
calculateBigInteger in TypeScript
1.0.0
py rs ts
24 tests
Apache-2.0
math.sin-cos
Sine and cosine of an angle in radians from + - * / only, so every language returns the same doubles.
sinCos in TypeScript
1.0.1
py rs ts
10 tests
Apache-2.0
math.basis-points
Convert a rate between percent, basis points and a plain ratio exactly, as decimal text or integer basis points.
A group of 3: convertRate, toBasisPoints, fromBasisPoints
2.0.0
py rs ts
45 tests
Apache-2.0
math.clamp
Clamp an integer to an inclusive range, refusing a range whose bounds are the wrong way round.
clamp in TypeScript
1.0.0
py rs ts
12 tests
Apache-2.0
math.round-float
Round a float half away from zero to 0-12 decimal places, identically in TypeScript, Python and Rust.
roundFloat in TypeScript
1.0.0
py rs ts
22 tests
Apache-2.0
math.integer-sqrt
Exact integer square root: the largest whole number whose square does not exceed n.
integerSqrt in TypeScript
1.0.0
py rs ts
11 tests
Apache-2.0
math.round-div
Integer division with an explicit rounding mode, for money arithmetic that must not drift.
roundDiv in TypeScript
1.0.0
py rs ts
14 tests
Apache-2.0
math.gcd-lcm
Greatest common divisor and least common multiple of two integers, exactly and without overflow.
A group of 3: gcdLcm, gcd, lcm
2.0.0
py rs ts
39 tests
Apache-2.0
charts.layout
Chart layout: the plot area inside margins, legend items wrapped into rows, and greedy label collision avoidance.
A group of 3: plotArea, legendRows, avoidCollisions
1.0.1
py rs ts
33 tests
Apache-2.0
text.format-decimal
Format a float as plain decimal text with fixed or trimmed places and optional grouping, identically in every language.
formatDecimal in TypeScript
1.0.0
py rs ts
19 tests
Apache-2.0
dates.day-count-fraction
Year fraction between two dates by ACT/365F, ACT/360, 30/360, 30E/360 or ACT/ACT ISDA, as an exact fraction.
dayCountFraction in TypeScript
1.0.0
py rs ts
21 tests
Apache-2.0
stats.weighted-average
Weighted average of integers, computed exactly and rounded once to stated decimals with an explicit rounding mode.
weightedAverage in TypeScript
1.0.0
py rs ts
21 tests
Apache-2.0
finance.markup-price
Selling price from a cost and a target margin or markup in basis points, with explicit rounding.
markupPrice in TypeScript
1.0.0
py rs ts
21 tests
Apache-2.0
construction.materials-area
Packs of tiles, paint, plasterboard or flooring to cover an area, with waste and coats, rounded up to whole packs.
materialsArea in TypeScript
1.0.0
py rs ts
18 tests
Apache-2.0
charts.shape
SVG path strings for lines, areas, steps, monotone curves, bars, arcs and pie slices, identical in every language.
A group of 7: linePath, areaPath, stepPath, monotoneCurve, barRects, arcPath, pieAngles
1.0.1
py rs ts
70 tests
Apache-2.0
charts.axis
Axis geometry as data: tick positions, tick marks, label anchors and gridlines for number, time and category axes.
A group of 5: axisFromTicks, numberAxis, timeAxis, bandAxis, gridLines
1.0.1
py rs ts
49 tests
Apache-2.0
agri.field-area
Field area in square metres, hectares and acres from a boundary polygon of latitude/longitude points.
fieldArea in TypeScript
1.0.0
py rs ts
14 tests
Apache-2.0
health.bsa Unreviewed
Body surface area in m² by the Mosteller and the DuBois & DuBois formulas, to 2 decimal places.
bodySurfaceArea in TypeScript
1.0.1
py rs ts
16 tests
Apache-2.0
construction.roof-pitch
Roof pitch in degrees, rafter length and roof slope area from span, rise and length.
roofPitch in TypeScript
1.0.0
py rs ts
15 tests
Apache-2.0
geo.distance
Great-circle distance in metres between two latitude/longitude points (haversine), to the millimetre.
distance in TypeScript
2.0.0
py rs ts
21 tests
Apache-2.0
charts.ticks
Axis ticks: a round step (1, 2 or 5 x 10^k), the ticks on it, and calendar ticks from days to years.
A group of 4: tickStep, niceTicks, timeTickInterval, timeTicks
1.0.0
py rs ts
57 tests
Apache-2.0
net.latency-summary
Summarise probe results: sent, received, loss, min/avg/max, p95 and jitter, in whole microseconds.
summariseLatency in TypeScript
1.0.0
py rs ts
16 tests
Apache-2.0
dates.add-days
Shift an ISO date by a whole number of days, forwards or backwards, with exact calendar arithmetic.
addDays in TypeScript
1.0.0
py rs ts
28 tests
Apache-2.0
money.compare
Compare two amounts of one currency, refusing to compare across currencies; min, max and clamp too.
A group of 4: compareMoney, minMoney, maxMoney, clampMoney
2.0.0
py rs ts
39 tests
Apache-2.0
auth.recovery-codes
Two-factor recovery codes: generate from caller entropy, hash for storage, and verify-and-consume as a pure step.
A group of 4: generateRecoveryCodes, normaliseRecoveryCode, hashRecoveryCode, consumeRecoveryCode
1.0.0
py rs ts
39 tests
Apache-2.0
charts.scale
Map data values onto screen positions and back: linear, log, time, band and point scales, and nice domains.
A group of 7: linearScale, invertLinear, niceDomain, logScale, timeScale, bandScale, pointScale
1.1.0
py rs ts
93 tests
Apache-2.0
stats.percentile
Percentile of a list of numbers by a named method: nearest-rank, or linear interpolation (R-7, Excel PERCENTILE.INC).
percentile in TypeScript
2.0.0
py rs ts
29 tests
Apache-2.0
subscriptions.mrr-arr
Monthly and annual recurring revenue from a list of subscriptions, normalising intervals and leaving out trials.
mrrArr in TypeScript
1.1.0
py rs ts
19 tests
Apache-2.0
charts.extent
The minimum and maximum of a series as [min, max], skipping gaps (null), or null when there is no value.
extent in TypeScript
1.0.1
py rs ts
15 tests
Apache-2.0
stats.standard-deviation
Population or sample standard deviation of a list of numbers, two-pass, rounded to stated decimals.
standardDeviation in TypeScript
2.0.0
py rs ts
21 tests
Apache-2.0
stats.moving-average
Simple or exponential moving average over a series, one value per full window, rounded to stated decimals.
movingAverage in TypeScript
2.0.0
py rs ts
24 tests
Apache-2.0
geo.bounding-box
Latitude/longitude bounding box that contains every point within a distance of a centre point.
boundingBox in TypeScript
2.0.0
py rs ts
15 tests
Apache-2.0
telecoms.call-rating
Rate a call from a rate deck: longest-prefix destination match, billing increments, connection fee and minimum charge.
rateCall in TypeScript
1.0.1
py rs ts
22 tests
Apache-2.0
charts.color
Hex colours to RGB and back, and sRGB channels to linear light and back, identically in every language.
A group of 4: parseHex, toHex, srgbToLinear, linearToSrgb
1.0.1
py rs ts
39 tests
Apache-2.0
subscriptions.proration
Mid-cycle plan change: credit for unused time on the old plan and charge for the rest of the period on the new one.
prorateChange in TypeScript
1.0.0
py rs ts
17 tests
Apache-2.0
inventory.eoq
Economic order quantity (Harris/Wilson): the order size that minimises ordering plus holding cost, in whole units.
economicOrderQuantity in TypeScript
1.0.0
py rs ts
20 tests
Apache-2.0
charts.format
Axis and label text for charts: tick numbers, SI prefixes (1.2k, 3.4M), percentages, dates and money.
A group of 5: formatTick, formatSi, formatPercent, formatDate, formatMoneyTick
1.0.0
py rs ts
61 tests
Apache-2.0
manufacturing.capacity
Capacity against routed load per work centre over a period, with efficiency, utilisation and overload flags.
workCentreLoad in TypeScript
1.0.0
py rs ts
14 tests
Apache-2.0
todo.summary
Counts for a todo list's header or footer: total, active, done, overdue, due today, percent done and "3 items left".
summariseTodos in TypeScript
1.0.0
py rs ts
13 tests
Apache-2.0
agri.growing-degree-days
Growing degree days (thermal time) from daily min/max temperatures, a base and an optional upper cap.
growingDegreeDays in TypeScript
1.0.0
py rs ts
18 tests
Apache-2.0
fleet.fuel-cost
Fuel cost of a trip from distance, fuel economy (UK or US mpg, or L/100km) and price per litre, exactly.
fuelCost in TypeScript
1.0.0
py rs ts
24 tests
Apache-2.0
manufacturing.batch-size
Economic batch quantity: the EOQ for a batch made at a finite production rate, in whole units.
economicBatchQuantity in TypeScript
1.0.0
py rs ts
20 tests
Apache-2.0
money.convert
Convert an amount to another currency at a supplied exact rate, with an explicit rounding mode.
convertMoney in TypeScript
1.0.0
py rs ts
19 tests
Apache-2.0
monitor.burn-rate
How fast an SLO's error budget is burning: the error rate as a multiple of the rate the SLO allows, in thousandths.
burnRate in TypeScript
1.0.0
py rs ts
17 tests
Apache-2.0
agri.gross-margin
Enterprise gross margin (output less variable costs), in total and per hectare or per head, in exact money.
grossMargin in TypeScript
1.0.0
py rs ts
14 tests
Apache-2.0
inventory.valuation-weighted-average
Perpetual weighted average cost: stock value and cost of sales from a movement ledger, rounding once per issue.
weightedAverageValuation in TypeScript
1.0.0
py rs ts
17 tests
Apache-2.0
agri.seed-rate
Seed rate in kg/ha from target plants per m², thousand-grain weight and expected establishment.
seedRate in TypeScript
1.0.0
py rs ts
17 tests
Apache-2.0
charts.stack
Stack several series for stacked bars and areas: on zero, normalised to 100%, or diverging around zero.
stack in TypeScript
1.0.0
py rs ts
14 tests
Apache-2.0
inventory.reorder-point
Reorder point: demand over the supplier lead time, rounded up to whole units, plus safety stock.
reorderPoint in TypeScript
1.0.0
py rs ts
13 tests
Apache-2.0
charts.interpolate-color
The colour at a point along a sequential or diverging ramp, mixed in OKLab so steps look even; hex in, hex out.
interpolateColor in TypeScript
1.0.0
py rs ts
19 tests
Apache-2.0
construction.concrete-volume
Concrete for slabs, strip footings, pads and round columns: volume to the litre and an order rounded up to 0.1 m³.
concreteVolume in TypeScript
1.0.0
py rs ts
19 tests
Apache-2.0
manufacturing.yield-scrap
Whole units to start for a required good output at a process yield, and the scrap that allows for.
inputForYield in TypeScript
1.0.0
py rs ts
15 tests
Apache-2.0
agri.feed-ration
Ration costing and dry matter intake from each feed's fresh weight, DM % and price per tonne, in exact money.
feedRation in TypeScript
1.0.0
py rs ts
15 tests
Apache-2.0
charts.histogram-bins
Bin values into histogram bins on round edges, by Sturges' rule, Freedman-Diaconis, or a fixed width.
histogramBins in TypeScript
1.0.0
py rs ts
17 tests
Apache-2.0
monitor.rollup
Aggregate a metric series into fixed time buckets (count, min, max, avg, sum, last), empty buckets included.
rollup in TypeScript
1.0.0
py rs ts
15 tests
Apache-2.0
fleet.vehicle-depreciation
A vehicle's current value from its cost, age and mileage, on retention curves the caller supplies, exactly.
vehicleDepreciation in TypeScript
1.0.0
py rs ts
20 tests
Apache-2.0
manufacturing.bom-explode
Explode a multi-level bill of materials into exact total quantities per component, with scrap and cycle checks.
explodeBom in TypeScript
1.0.0
py rs ts
17 tests
Apache-2.0
monitor.status-code-summary
Count HTTP status codes by class (1xx to 5xx) and give the server error and client error rates in basis points.
summariseStatusCodes in TypeScript
1.0.0
py rs ts
12 tests
Apache-2.0
banking.savings-aer
AER (annual equivalent rate) from a gross nominal rate and how often interest is paid, to two decimal places.
savingsAer in TypeScript
1.0.0
py rs ts
14 tests
Apache-2.0
monitor.error-budget
How much of an SLO's error budget is allowed, used and left, from good and bad event counts or seconds.
errorBudget in TypeScript
1.0.0
py rs ts
19 tests
Apache-2.0
inventory.stock-turnover
Stock turnover ratio, days inventory outstanding and days of cover for a period, computed exactly.
stockTurnover in TypeScript
1.0.0
py rs ts
13 tests
Apache-2.0
retail.price-rounding
Snap a price to a price point: charm pricing (.99, .95), nearest 5p or 10p, rounding up, down or to nearest.
roundPrice in TypeScript
1.0.0
py rs ts
25 tests
Apache-2.0
time.round-to-increment
Round a duration in minutes to a billing increment such as 6 or 15 minutes, up, down or to nearest.
roundToIncrement in TypeScript
1.0.0
py rs ts
18 tests
Apache-2.0
invest.bond-yield Unreviewed
Current yield and yield to maturity of a fixed-coupon bond from its clean price, as Excel's YIELD defines it.
bondYield in TypeScript
1.0.2
py rs ts
27 tests
Apache-2.0
lending.apr Unreviewed
Consumer-credit APR from drawdowns and repayments, by the FCA CONC App 1.2.6 equation, to one decimal place.
apr in TypeScript
1.0.1
py rs ts
22 tests
Apache-2.0
invest.cagr Unreviewed
Compound annual growth rate between two values over a whole or fractional number of years, in basis points.
cagr in TypeScript
1.0.1
py rs ts
22 tests
Apache-2.0
health.egfr Unreviewed
eGFR in mL/min/1.73 m² by the race-free CKD-EPI 2021 creatinine equation, from creatinine in µmol/L or mg/dL.
egfrCkdEpi2021 in TypeScript
1.0.1
py rs ts
25 tests
Apache-2.0
payroll.overtime Unreviewed
Pay for the time worked in a period split into multiplier bands: basic, time and a half after 40 hours, double time.
overtimePay in TypeScript
1.0.1
py rs ts
11 tests
Apache-2.0
property.service-charge-apportion Unreviewed
Apportion a service charge across units by lease fraction, floor area or fixed percentage, exact to the penny.
apportionServiceCharge in TypeScript
1.0.1
py rs ts
19 tests
Apache-2.0
insurance.rating-factors Unreviewed
Premium from a base rate times factor-table lookups, loadings and discounts, within minimum and maximum premiums.
ratePremium in TypeScript
1.0.1
py rs ts
24 tests
Apache-2.0
health.bmi Unreviewed
Adult body mass index (kg/m², 1 decimal place) and its NICE/WHO weight category.
bmi in TypeScript
1.0.1
py rs ts
22 tests
Apache-2.0
agri.spray-mix Unreviewed
Sprayer tank mix: tank fills, and product and water per full and part tank, for an area, water volume and dose.
sprayMix in TypeScript
1.0.1
py rs ts
14 tests
Apache-2.0
payroll.pro-rata-salary Unreviewed
Salary for part of a pay period and for part-time hours, by calendar days or working days, rounded once.
proRataSalary in TypeScript
1.0.1
py rs ts
13 tests
Apache-2.0
invest.time-weighted-return Unreviewed
Time-weighted return from valuations taken at each external cash flow, geometrically linked exactly.
timeWeightedReturn in TypeScript
1.0.1
py rs ts
22 tests
Apache-2.0
lending.early-settlement Unreviewed
Early settlement figure and rebate on UK regulated consumer credit, per the Early Settlement Regulations 2004.
earlySettlement in TypeScript
1.0.1
py rs ts
18 tests
Apache-2.0
lending.loan-payment Unreviewed
Level repayment for a loan (annuity formula), computed exactly and rounded once, the way you choose.
loanPayment in TypeScript
1.0.1
py rs ts
23 tests
Apache-2.0
insurance.loss-ratio Unreviewed
Loss ratio, expense ratio and combined ratio in basis points, from earned premium, incurred claims and expenses.
lossRatios in TypeScript
1.0.1
py rs ts
12 tests
Apache-2.0
lending.ltv Unreviewed
Loan-to-value ratio in basis points, and the band it falls in from a band table you supply.
loanToValue in TypeScript
1.0.1
py rs ts
17 tests
Apache-2.0
lending.daily-interest Unreviewed
Interest accrued day by day on a changing balance under a day-count convention, summed exactly and rounded once.
dailyInterest in TypeScript
1.0.1
py rs ts
21 tests
Apache-2.0
invest.money-weighted-return Unreviewed
Money-weighted return (XIRR) of dated cash flows on Excel's actual/365 convention, solved exactly in fixed point.
moneyWeightedReturn in TypeScript
1.0.1
py rs ts
24 tests
Apache-2.0
money.add
Add, subtract and negate monetary amounts, refusing to mix currencies.
addMoney in TypeScript
1.0.1
py rs ts
12 tests
Apache-2.0
education.gpa
Grade point average on a 4.0 scale from letter grades and credit hours, weighted by credits and rounded once.
gpa in TypeScript
1.0.0
py rs ts
22 tests
Apache-2.0
text.integer-to-words
Spell out a whole number in British English words, with "and" the way a cheque writes it.
integerToWords in TypeScript
1.0.0
py rs ts
25 tests
Apache-2.0
education.weighted-grade
Weighted percentage across coursework and exam components, exact as a fraction, then rounded once.
weightedGrade in TypeScript
1.0.0
py rs ts
22 tests
Apache-2.0
money.amount
A currency-tagged monetary amount held in integer minor units.
money in TypeScript
1.0.2
py rs ts
17 tests
Apache-2.0
money.apply-rate
Apply a rate expressed in basis points to a monetary amount, with an explicit rounding mode.
applyRate in TypeScript
1.0.1
py rs ts
22 tests
Apache-2.0
text.number-to-words
Write a money amount in words for a cheque: "one thousand two hundred and thirty-four pounds and fifty-six pence".
amountInWords in TypeScript
1.0.0
py rs ts
16 tests
Apache-2.0
money.format
Render a monetary amount as text, using the currency's real minor-unit precision.
formatMoney in TypeScript
1.0.0
py rs ts
11 tests
Apache-2.0
education.fee-instalments
Tuition fee instalment schedule from a total, shares and due dates, exact to the penny.
feeInstalments in TypeScript
1.0.0
py rs ts
20 tests
Apache-2.0
finance.margin
Profit on a sale with both the margin and the markup, so the two are never confused.
margin in TypeScript
1.0.0
py rs ts
13 tests
Apache-2.0
form.money-input
Read a typed amount as minor units for its currency and locale, check min/max, and format it back.
A group of 3: parseMoneyInput, formatMoneyInput, moneyInputFormat
1.0.0
py rs ts
61 tests
Apache-2.0
finance.invoice.calculate
Calculate a complete invoice: line nets, VAT per line, totals and a VAT summary grouped by rate.
calculateInvoice in TypeScript
1.0.1
py rs ts
15 tests
Apache-2.0