COBOL Manual for TNS/E Programs (H06.03+)

Intrinsic Functions
HP COBOL Manual for TNS/E Programs520347-003
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.
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