Returns the trigonometric tangent of the specified angle value.
An angle in radians ranging from 0 to 2 Pi. It can be specified as a value, a variable, or an expression.
READ "Input a number: ",num
WRITE !,"the tangent is: ",$ZTAN(num)
QUIT
The following example compares the results from Caché fractional numbers (
$DECIMAL numbers) and
$DOUBLE numbers. In both cases, the tangent of 0 is exactly 0, but the tangent of pi is a negative fractional number (not exactly 0):
WRITE !,"the tangent is: ",$ZTAN(0.0)
WRITE !,"the tangent is: ",$ZTAN($DOUBLE(0.0))
WRITE !,"the tangent is: ",$ZTAN($ZPI)
WRITE !,"the tangent is: ",$ZTAN($DOUBLE($ZPI))
WRITE !,"the tangent is: ",$ZTAN(1.0)
WRITE !,"the tangent is: ",$ZTAN($DOUBLE(1.0))