Cotangent function.
An angle in radians, specified as a nonzero value. It can be specified as a value, a variable, or an expression. A value of 0 generates an <ILLEGAL VALUE> error. A non-numeric string is evaluated as 0.
READ "Input a number: ",num
IF num=0 { WRITE !,"zero is an illegal value" }
ELSE {
WRITE !,"the cotangent is: ",$ZCOT(num)
}
QUIT
WRITE !,"the cotangent is: ",$ZCOT(1.0)
WRITE !,"the cotangent is: ",$ZCOT($DOUBLE(1.0))
WRITE !,"the cotangent is: ",$ZCOT(-1.0)
WRITE !,"the cotangent is: ",$ZCOT($DOUBLE(-1.0))
WRITE !,"the cotangent is: ",$ZCOT($ZPI/2)
WRITE !,"the cotangent is: ",$ZCOT($DOUBLE($ZPI)/2)