READ "Input a number: ",num
WRITE !,"the arc tangent is: ",$ZARCTAN(num)
QUIT
The following example compares the results from InterSystems IRIS fractional numbers ($DECIMAL numbers) and $DOUBLE numbers. In both cases, the arc tangent of pi/2 is a fractional number (not 1), but the arc tangent of 0 is 0:
WRITE !,"the arc tangent is: ",$ZARCTAN(0.0)
WRITE !,"the arc tangent is: ",$ZARCTAN($DOUBLE(0.0))
WRITE !,"the arc tangent is: ",$ZARCTAN($ZPI)
WRITE !,"the arc tangent is: ",$ZARCTAN($DOUBLE($ZPI))
WRITE !,"the arc tangent is: ",$ZARCTAN($ZPI/2)
WRITE !,"the arc tangent is: ",$ZARCTAN($DOUBLE($ZPI)/2)