forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompound.lcdoc
More file actions
57 lines (35 loc) · 1.34 KB
/
compound.lcdoc
File metadata and controls
57 lines (35 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Name: compound
Type: function
Syntax: compound(<interestRate>, <numberOfPeriods>)
Summary:
<return|Returns> the principal plus accrued interest of an investment.
Introduced: 1.0
OS: mac, windows, linux, ios, android
Platforms: desktop, server, mobile
Example:
compound(.05,20)
Example:
put theInvestment * compound(yearlyInterest,numberYears) into endValue
Parameters:
interestRate(number):
A positive number. The <interestRate> is expressed as a fraction of 1 so,
for example, an 8% rate is written .08.
numberOfPeriods(integer):
A positive number.
Returns(number):
The <compound> <function> <return|returns> a positive number.
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 + <interestRate>)^( <numberOfPeriods>)
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 operation|math operations> for more
information.
References: function (control structure), annuity (function),
round (function), return (glossary), math operation (glossary)
Tags: math