The CEXP function accepts any complex number and returns the value of e raised to that number. The value of the exponent is calculated by the use of DeMoivre's relationship. Refer to the information given under “Definitions Used in Complex Function Descriptions” earlier in this section. The basic identity that COS**2 (x) = 1 - SIN**2 (x), is the following:
e**(x+iy) = e**x ((+ or -)SQRT(1-SIN**2 (y))+i SIN(y))
The value of y is taken modulo 2(pi) before the sine function is applied. The negative sign on the square root is chosen if the original y is in the second or third quadrant.