This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see How to Migrate to InterSystems IRIS, available on the WRC Distributions page (login required).

# \$ZCSC

Cosecant function.

## Synopsis

```\$ZCSC(n)
```

### Parameter

Argument Description

## Description

\$ZCSC returns the trigonometric cosecant of n. The result is a signed decimal number.

## Parameter

### n

An angle in radians, specified as a nonzero number. It can be specified as a value, a variable, or an expression. Specifying 0 generates an <ILLEGAL VALUE> error; specifying \$DOUBLE(0) generates a <DIVIDE> error. A non-numeric string is evaluated as 0.

## Examples

The following example permits you to compute the cosecant of a number:

```   READ "Input a number: ",num
IF num=0 { WRITE !,"ILLEGAL VALUE: zero not permitted" }
ELSE {
WRITE !,"the cosecant is: ",\$ZCSC(num)
}
QUIT```

The following example compares the results from Caché fractional numbers (\$DECIMAL numbers) and \$DOUBLE numbers. In both cases, the cosecant of pi/2 is exactly 1:

```  WRITE !,"the cosecant is: ",\$ZCSC(\$ZPI)
WRITE !,"the cosecant is: ",\$ZCSC(\$DOUBLE(\$ZPI))
WRITE !,"the cosecant is: ",\$ZCSC(\$ZPI/2)
WRITE !,"the cosecant is: ",\$ZCSC(\$DOUBLE(\$ZPI)/2)
WRITE !,"the cosecant is: ",\$ZCSC(\$DOUBLE(\$ZPI/2))```