Language Reference Guide : 6. Functions : Finance Library Functions : CTERM Function
 
Share this page                  
CTERM Function
The CTERM function calculates the number of compounding periods required for an investment of a present value and earning a given interest rate per period to yield a specified future value.
This function has the following syntax:
CTERM(i = value, fv = value, pv = value)
Arguments
Data Type
Description
i
Float
Interest rate (as fraction)
fv
Float
Future value of investment
pv
Float
Present value of investment
This function returns:
Float—Number of periods or term needed for the present value (pv) to increase in value to a future value (fv) at a compounding interest rate (i)
Null—On error
Example—CTERM function:
/*  Compute the number of years for a $5,000
**  investment to grow to $10,000 at 8% interest with
**  annual compounding.
*/
declare
     intRate = Float;
     futureVal = Float;
     presentVal = Float;
enddeclare
begin
     intRate = .08;          /* 8% per year */
     futureVal = 10000;
     presentVal = 5000;
     years = cterm(i = intRate, fv = futureVal, pv = presentVal);
end