Returns the trigonometric sine of the specified angle value.
Examples
The following example permits you to compute the sine of a number:
READ "Input a number: ",num
IF $ZABS(num)>(2*$ZPI) { WRITE !,"number is a larger than 2 pi" }
ELSE {
WRITE !,"the sine is: ",$ZSIN(num)
}
QUIT
The following example compares the results from InterSystems IRIS fractional numbers ($DECIMAL numbers) and $DOUBLE numbers. In both cases, the sine of pi is a fractional number (not 0), but the sine of pi/2 is set to exactly 1:
WRITE !,"the sine is: ",$ZSIN($ZPI)
WRITE !,"the sine is: ",$ZSIN($DOUBLE($ZPI))
WRITE !,"the sine is: ",$ZSIN($ZPI/2)
WRITE !,"the sine is: ",$ZSIN($DOUBLE($ZPI)/2)
In the following example, all $ZSIN functions return zero (0):
WRITE !,"the sine is: ",$ZSIN(0.0)
WRITE !,"the sine is: ",$ZSIN(-0.0)
WRITE !,"the sine is: ",$ZSIN($DECIMAL(0.0))
WRITE !,"the sine is: ",$ZSIN($DOUBLE(0.0))
WRITE !,"the sine is: ",$ZSIN($DECIMAL(-0.0))
WRITE !,"the sine is: ",$ZSIN($DOUBLE(-0.0))
WRITE !,"the sine is: ",$ZSIN(-$DECIMAL(0.0))
WRITE !,"the sine is: ",$ZSIN(-$DOUBLE(0.0))
This is true on all platforms, including AIX.