You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<summary><glossary tag="return">Returns</glossary> the principal plus accrued interest of an investment.</summary>
<examples>
<example>compound(.05,20)</example>
<example>put theInvestment * compound(yearlyInterest,numberYears) into endValue</example>
</examples>
<description>
<p>Use the <b>compound</b> <control_st tag="function">function</control_st> to calculate the value of an investment that earns interest.</p><p/><p><b>Parameters:</b></p><p>The <i>interestRate</i> is a positive number. The <i>interestRate</i> is expressed as a fraction of 1 so, for example, an 8% rate is written<code> .08</code>.</p><p/><p>The <i>numberOfPeriods</i> is a positive number.</p><p/><p><b>Value:</b></p><p>The <b>compound</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a positive number.</p><p/><p><b>Comments:</b></p><p>The formula for the value of an compound-interest-bearing account is</p><p/><p> (1 + <i>interestRate</i>)^( <i>numberOfPeriods</i>)</p><p/><p>The <b>compound</b> <control_st tag="function">function</control_st> calculates this value.</p><p/><p>The <i>numberOfPeriods</i> and the <i>interestRate</i> must use the same unit of time. For example, if the periods are months, the interest rate is the interest per month.</p>