COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-9
ANNUITY Function
ANNUITY Function
ANNUITY, a numeric function, returns a value that approximates the ratio of an annuity
paid at the end of each period for a specified number of periods at a specified interest
rate to an initial investment of one. Interest is applied at the end of the period, before
the payment (annuity immediate).
interest-rate
is a numeric argument whose value is greater than or equal to zero.
number-of-periods
is a positive integer.
When the value of interest-rate is zero, the returned value is approximately:
When the value of interest-rate is not zero, the returned value is approximately:
Note. This function requires the CRE. To use this function in a TNS HP COBOL program,
compile the program with the directive ENV COMMON.
( )
ANNUITYFUNCTION
interest-rate number-of-periods
VST422.vsd
1
number-of-periods
---------------------------------
interest-rate
interest-rate+ )
number-of-periods–
--------------------------------------------------------------------------------------------------------