returns the principal plus accrued interest of an investment.
# Metadata
Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:
# Syntax
compound(interestRate, numberOfPeriods)
# Params
- interestRate : A positive number. The <interestRate> is expressed as a fraction of 1 so, for example, an 8% rate is written .08. - numberOfPeriods : A positive number.
# Examples
compound(.05,20)
put theInvestment * compound(yearlyInterest,numberYears) into endValue
# Description
The formula for the value of an compound-interest-bearing account is
(1 + interestRate)^( numberOfPeriods)
The numberOfPeriods and the interestRate must use the same unit of time. For example, if the periods are months, the interestRate is the interest per month.
If a math operation on finite inputs produces a non-finite output, an execution error is thrown. See math operations for more information.
# Tags
math,
# See
- **control structure:** function - **glossary:** return, math operation - **function:** annuity, round