The calculation runs month by month rather than using a single series formula. The formula S = P(1 + i)ⁿ + A((1 + i)ⁿ − 1) ÷ i is valid only when deposits arrive exactly in sync with capitalization and the term is an integer number of periods. As soon as deposit frequency differs from accrual frequency, withdrawals are added, or the term ends partway through a period, the series gives the wrong result. A monthly calculation that carries the balance forward handles any combination correctly. At a zero rate, no interest accrues, and the final amount equals the amount invested. One side effect of the monthly model is that a partial period no longer falls below the simple-interest result, because interest is calculated for the actual number of months rather than a fractional power.