# Section 8.12.1.21:
$COMPLEX

create( re, im : ETP ) : NTP ; -- This feature creates and returns a complex number with the given -- real and imaginary components. create_real( repart : ETP ) : NTP ; -- This feature creates and returns a complex number with the given -- real component with the imaginary part zero. re : ETP ; -- This feature returns the real component of self. im : ETP ; -- This feature returns the imaginary component of self. magnitude : ETP ; -- This feature returns the absolute magnitude of self. magnitude_squared : ETP ; -- This feature returns the square of the absolute magnitude of self. -- It is a synonym for abs_squared. reciprocal : NTP ; -- This feature returns the multiplicative inverse of self. conjugate : NTP ; -- This feature returns the complex conjugate of self. times( factor : ETP ) : NTP ; -- This feature scales both real and imaginary components of self by -- the given factor. div( divisor : ETP ) : NTP ; -- This feature divides both components of self by the given divisor, -- returning the result. cube_root : NTP ; -- This feature returns the complex cube root of self. is_within( radius : ETP, other : NTP ) : BOOL ; -- This feature returns true if and only if self is within the given -- radius of other.

| Language Index |  | Library Index |  | Numeric Index

Comments or enquiries should be made to Keith Hopper. Page last modified: Wednesday, 21 February 2001. |