# finance.compound-interest
The interest is accrued one period at a time and rounded to a whole minor unit
at every step, because that is what the ledger behind a statement actually does:
each period posts a real, whole-penny entry and the next period earns interest
on that posted balance.
A single principal * (1 + r/n)^(n*y) at the end is a different number. 1000.00
at a nominal 12% compounded monthly for a year accrues 1126.84 here and 1126.83
by pow(); 2500.00 at 3.75% monthly over five years differs by three pence.
Neither difference is large and neither can be argued away at a reconciliation,
because the statement is the authority and the statement was built by
accumulating rounded postings.
The period rate is the nominal annual rate divided by periodsPerYear, and that
division stays inside the same integer division that rounds the period's
interest. Rounding the RATE first would be much worse: a nominal 4.5% compounded
monthly is 37.5 basis points per period, and forcing that to 37 or 38 basis
points moves the answer far more than any penny of accrual rounding. Where the
period rate is a whole number of basis points this is exactly money.apply-rate's
arithmetic.
The rate is nominal, not AER/APY. 1200 basis points compounded monthly is a
nominal 12%, which is an effective 12.68%. Do not pass an AER here and expect it
back.
Negative rates and negative principals both work and round symmetrically away
from zero, so an overdraft accrues the mirror image of a savings balance.