**** Complex numbers. _ Some of the algorithms are taken from: Press, Flannery, Teukolsky, and Vettering, "Numerical Recipes in C", second edition, Cambridge University Press, 1993. _ Some of the choices of branch cut were chosen to be consistent with: Guy L. Steele, "Common Lisp, The Language", second edition, 1990, Digital Press.

Flattened version is here

Ancestors
 \$CPX_NUMBER{_,_} \$NFE{_} \$IS_EQ \$STR \$NIL \$IS_NIL

Descendants
 CPX CPXD

Public

 **** Real and imaginary parts.
 **** Real and imaginary parts.

Writable Attributes
 **** Real and imaginary parts.
 **** Real and imaginary parts.

Features
 **** For conformance with \$NFE
 **** The square of the absolute magnitude of self.
 **** The absolute magnitude of self. Cannot overload abs From Numerical Recipes in C, 2nd ed. p. 949.
 **** -i log(z + sqrt(1-z^2)) better to use: (pi/2)-asin(z) Steele p. 305.***
 **** log(z+(z+1)sqrt((z-1)/(z+1))) Steele p. 308***
 **** -i log(iz + sqrt(1-z^2)) Steele p. 305.***
 **** log(z+sqrt(1+z^2)) Steele p. 308***
 **** (log(1+i*y)-log(1-i*y))/(2*i) Steele p. 307.***
 **** log((1+z)sqrt(1/(1-z^2))) Steele p. 308***
 **** Ignores self, e^i*f=cos f + i sin f . Steele p. 304.
 **** The complex conjugate of self.
cos:SAME
 **** (e^z+e^(-z))/2 Steele p. 308***
create(f: FLT): SAME
create(f: FLTD): SAME
 **** A complex number with real part `re' and imaginary part `im'.
create(i: INT): SAME
 **** A complex number with magnitude `mag' and phase `phase'.
create_real(x:T):SAME
 **** Self cubed
 **** The cube root of self. preliminary, but working.
 **** The ratio of self and `c'. From Numerical Recipes in C, 2nd ed. p. 949.
 **** Self div the floating point f.
 **** The complex exponential `e^self'.
 **** Return true if the two numbers are equal
 **** Return true if self is nil
 **** self is within a circle around c with radius r
 **** The complex logarithm. The chosen branch is `log |z| + i phase(z)'. Same convention as Steele, p. 302.
 **** The absolute magnitude of self.
 **** The square of the absolute magnitude of self.
 **** Maximum values of real and imaginary part
 **** The difference of self and `c'.
 **** The additive inverse of self.
 **** Return a nil valued complex number with real and imaginary parts both nil
 **** A unit value (real part=1, imaginary part=0)
 **** The angle part of the polar represenation of self. `-pi < res <= pi'. Also get "-pi" from a negative real part and a "-0.0" imaginary part. They say 0+0i should be +0, 0-0i should be -0, -0+0i should be +pi, and -0-0i should be -pi. Same convention as Steele, p. 303.
 **** The sum of self and `c'.
 **** self^c = exp(c*log(self))
 **** The multiplicative inverse of self.
 **** If not zero, a number with same phase as self but unit magnitude. If it is, then returns self. Steele, p. 304***
sin:SAME
 **** (e^z-e^(-z))/2 Steele p. 308***
 **** The square root of self. From Numerical Recipes in C, 2nd ed. p. 949. Steele, p. 302 chooses the branch cut by `e^((log z)/2)'
 **** Self squared
 **** A string representation of self of the form "1.02+3.23i".
tan:SAME
 **** (e^z-e^(-z))/(e^z+e^(-z)) Steele p. 308***
 **** The product of self and `c'.
 **** Self times the floating point c.
 **** A zero valued complex number