Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

compound

Calculates compound interest with specified frequency.

Formula: principal × (1 + rate/n)^(n×t)

Arguments

  • principal - Initial amount
  • rate - Annual interest rate (e.g., 0.1 for 10%)
  • n - Compounding frequency per period (e.g., 12 for monthly)
  • t - Number of periods (e.g., years)

Fully qualified path: cairo_fp::f128::math::interest::compound

fn compound(principal: Fixed, rate: Fixed, n: Fixed, t: Fixed) -> Fixed