COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Example 179 ACOS Function
Code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A PICTURE S9V99.
PROCEDURE DIVISION.
MOVE FUNCTION ACOS (-1) TO A.
DISPLAY A.
MOVE FUNCTION ACOS (.25) TO A.
DISPLAY A.
MOVE FUNCTION ACOS (.5) TO A.
DISPLAY A.
MOVE FUNCTION ACOS (.75) TO A.
DISPLAY A.
MOVE FUNCTION ACOS (1) TO A.
DISPLAY A.
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:
ANNUITY Function 659