COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-54
SIN Function
SIN Function
SIN, a numeric function, returns a value that approximates the sine of the angle or arc
(in radians) specified by its argument.
argument
is a numeric argument.
The returned value approximates the sine of the value of argument. It is a floating-
point number in the range -1 to +1. It has no implied decimal point and is 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-37. SIN Function
Code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A PICTURE S9V99.
PROCEDURE DIVISION.
MOVE FUNCTION SIN (-10) TO A.
DISPLAY A.
MOVE FUNCTION SIN (0) TO A.
DISPLAY A.
MOVE FUNCTION SIN (.25) TO A.
DISPLAY A.
MOVE FUNCTION SIN (15.5) TO A.
DISPLAY A.
MOVE FUNCTION SIN (45) TO A.
DISPLAY A.
Output:
0.54
0.00
0.24
0.20
0.85
( )
SINFUNCTION argument
VST460.vsd