compound

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
compound(<interestRate>, <numberOfPeriods>)
Summary

Returns the principal plus accrued interest of an investment.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
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.

Example
compound(.05,20)
put theInvestment * compound(yearlyInterest,numberYears) into endValue
Values
NameTypeDescription
return

The compound function returns a positive number.

RelatedControl Structure: function
Glossary: return, math operation
Function: annuity, round
Description

Use the compound function to calculate the value of an investment that earns interest.

The formula for the value of an compound-interest-bearing account is

(1 + <b>interestRate</b>)^( <b>numberOfPeriods</b>)

The compound function calculates this value.

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.

Tagsmath