11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Math and Time FunctionsParametersnAn angle in radians ranging from Pi to 2 Pi (inclusive). It can be specified as a value, a variable,or an expression. You can specify the value Pi by using the $ZPI special variable. You canspecify positive or negative values smaller than Pi or larger than 2 Pi; <strong>Caché</strong> resolve thesevalues to the corresponding multiple of Pi. For example, 3 Pi is equivalent to Pi, and negativePi is equivalent to Pi.ExampleThe following example permits you to compute the sine of a number:READ "Input a number: ",numIF $ZABS(num)>(2*$ZPI) { WRITE !,"number is a larger than 2 pi" }ELSE {WRITE !,"the sine is: ",$ZSIN(num)}QUITSee Also• $ZCOS function• $ZARCSIN function• $ZPI special variable$ZSQRReturns the square root of a specified number.$ZSQR(n)ParameternAny positive number, or zero. (The null string and non-numeric string values aretreated as a zero.) Can be specified as a value, a variable, or an expression.Description$ZSQR returns the square root of n. It returns the square root of 1 as 1. It returns the squareroot of 0 and the square root of a null string ("") as 0. Specifying a negative number invokes374 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!