Loading...
Select Version
The ACOS function returns a numeric value in radians that approximates the arccosine of argument-1.
The type of this function is numeric.
Format
FUNCTION ACOS (argument-1)
Arguments
argument-1 must be class "numeric".
The value of argument-1 must be greater than or equal to
-1 and less than or equal to +1.
Returned values
The returned value is the approximation of the arc cosine of argument-1 and is greater than or equal to zero and less than or equal to pi.
The error default value is
-2.
See also: COS, SIN, ASIN, TAN, ATAN
Example 9-1
...
DATA DIVISION.
WORKING-STORAGE SECTION.
01 AS PIC S9V999 VALUE -0.25.
01 R PIC 9V99.
01 RES PIC +9.99.
PROCEDURE DIVISION.
P1 SECTION.
MAIN.
COMPUTE R = FUNCTION ACOS (AS).
MOVE R TO RES.
DISPLAY RES UPON T.
STOP RUN.
Result: +1.82