Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ACOS - Arccosine

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

  1. argument-1 must be class "numeric".

  2. The value of argument-1 must be greater than or equal to -1 and less than or equal to +1.

Returned values

  1. 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.

  2. 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