How we calculate

Every calculator on this site is built the same way, in this order.

1. The source comes first

Before any code, we find who defines the calculation: a federal agency, a published standard, or physics. The calculator follows that source's formula and cites it on the page. Where a standard is copyrighted, the calculator follows the free public guidance that applies it, and names it.

2. Worked examples become tests

We copy the source's own worked examples, exactly as printed, into automated tests, and add cases worked by hand from its formula, including the edges: zero, the largest sensible input and halves of a cent. A calculator with fewer than ten such cases is not published. Further tests check what must always hold: more use never costs less, and the parts add up to the total.

3. Prices and rates are data, with a date

No price, rate or threshold is written into a calculator. Each one lives in a data file with its official source, the date it was retrieved and the period it applies to. New official data is fetched by a script, and a person reviews every changed value before it reaches a page. The page shows the date of the data it used.

4. Money is exact

Money is computed in decimal arithmetic, never in the rounded binary numbers computers use by default, and rounded once, at the step and by the rule the source names.

5. Every step is shown

Under each result, "How this was calculated" lists every step with its formula, the figures that went in and the source of each price, so you can check the answer yourself.

6. Who reviews the pages

Every page is reviewed by the DirectCalculators team: its formula is tested against the worked examples its source publishes, where the source gives any, and against cases worked by hand, and every figure it uses comes from a source the page names. Where every source of a page has been read again and each value compared, the page says so, with the date of that check.

What a result is

A result is the named source's formula worked on the figures shown beside it. It is not a quote, a bill, an engineering load calculation, or legal, tax or financial advice.