]>
The Complex constructor implements complex objects over a commutative ring R. Typically, the ring R is Integer, Fraction Integer, Float or DoubleFloat. R can also be a symbolic type, like Polynomial Integer. For more information about the numerical and graphical aspects of complex numbers, see ugProblemNumeric .
Complex objects are created by the complexcomplexComplex operation.
The standard arithmetic operations are available.
If R is a field, you can also divide the complex objects.
Use a conversion (ugTypesConvertPage in Section ugTypesConvertNumber ) to view the last object as a fraction of complex integers.
The predefined macro %i is defined to be complex(0,1).
You can also compute the conjugateconjugateComplex and normnormComplex of a complex number.
The realrealComplex and imagimagComplex operations are provided to extract the real and imaginary parts, respectively.
The domain Complex Integer is also called the Gaussian integers. If R is the integers (or, more generally, a EuclideanDomain), you can compute greatest common divisors.
You can also compute least common multiples.
You can factorfactorComplex Gaussian integers.