The following example permits you to compare the arc cosine and the arc sine of a number:
READ "Input a number: ",num
IF num>1 { WRITE !,"ILLEGAL VALUE: number too big" }
ELSEIF num<-1 { WRITE !,"ILLEGAL VALUE: number too small" }
ELSE {
WRITE !,"the arc cosine is: ",$ZARCCOS(num)
WRITE !,"the arc sine is: ",$ZARCSIN(num)
}
QUIT
The following example compares the results from InterSystems IRIS fractional numbers ($DECIMAL numbers) and $DOUBLE numbers. In both cases, the arc cosine of 1 is exactly 0:
WRITE !,"the arc cosine is: ",$ZARCCOS(0.0)
WRITE !,"the arc cosine is: ",$ZARCCOS($DOUBLE(0.0))
WRITE !,"the arc cosine is: ",$ZARCCOS(1.0)
WRITE !,"the arc cosine is: ",$ZARCCOS($DOUBLE(1.0))
WRITE !,"the arc cosine is: ",$ZARCCOS(-1.0)
WRITE !,"the arc cosine is: ",$ZARCCOS($DOUBLE(-1.0))