Loading...
Select Version
The COS function returns the cosine of the angle or arc that is specified in radians by argument-1.
The type of this function is numeric.
Format
FUNCTION COS (argument-1)
Argument
argument-1 must be class "numeric".
Returned value
The returned value is the approximation of the cosine of argument-1 and is greater than or equal to
-1 and less than or equal to +1.
See also: ACOS, SIN, ASIN, TAN, ATAN
Example 9-8
...
DATA DIVISION.
WORKING-STORAGE SECTION.
01 R PIC S9V9(10).
01 RES PIC -9.9(10).
PROCEDURE DIVISION.
P1 SECTION.
MAIN.
COMPUTE R = FUNCTION COS (3.1425).
MOVE R TO RES.
DISPLAY RES UPON T.
STOP RUN.
Result: -0.9999995883