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.

values 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 secant of a number:READ "Input a number: ",numIF $ZABS(num)>(2*$ZPI) { WRITE !,"number is a larger than 2 pi" }ELSE {WRITE !,"the secant is: ",$ZSEC(num)}QUITSee Also• $ZCSC function• $ZPI special variable$ZSIN$ZSINReturns the trigonometric sine of the specified angle value.$ZSIN(n)ParametersnAngle in radians ranging from Pi to 2 Pi (inclusive). Other supplied numeric valuesare converted to a value within this range.Description$ZSIN returns the trigonometric sine of n. The result is a signed decimal number rangingfrom 1 to -1 (see note).Note:$ZSIN (like all trigonometric functions) calculates its values based on pi roundedto the number of available decimal digits. Therefore, the value returned by$ZSIN($ZPI) is .000000000000000000462644 and $ZSIN($ZPI*2) is–.00000000000000000092529. For this reason you should not perform limit testscomparing these returned values to 0. $ZSIN(0) returns 0.<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 373

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

Saved successfully!

Ooh no, something went wrong!