COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-60
TAN Function
TAN Function
TAN, a numeric function, returns a value that approximates the tangent of the angle or
arc (in radians) specified by its argument.
argument
is a numeric argument.
The returned value approximates the tangent of the value of argument. It is a floating-
point number with no implied decimal point, precise to approximately 14 digits.
Note. This function requires the CRE. To use this function in a TNS HP COBOL program,
compile the program with the directive ENV COMMON.
Example 14-41. TAN Function
Code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A PICTURE S9V99.
PROCEDURE DIVISION.
MOVE FUNCTION ATAN (-10) TO A.
DISPLAY A.
MOVE FUNCTION ATAN (0) TO A.
DISPLAY A.
MOVE FUNCTION ATAN (.25) TO A.
DISPLAY A.
MOVE FUNCTION ATAN (15.5) TO A.
DISPLAY A.
MOVE FUNCTION ATAN (45) TO A.
DISPLAY A.
Output:
-0.64
0.00
0.25
-0.21
1.61
( )
TANFUNCTION argument
VST464.vsd