This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Complex

Complex
is the head used for complex numbers.
  • You can enter a complex number in the form x+Iy.
  • can be used to stand for a complex number in a pattern.
  • You have to use Re and Im to extract parts of Complex numbers.
Enter a complex number:
Complex is the Head for complex numbers:
Enter a complex number:
In[1]:=
Click for copyable input
Out[1]=
Complex is the Head for complex numbers:
In[2]:=
Click for copyable input
Out[2]=
Enter a purely imaginary number:
Even though there is no real part it has Head Complex:
The FullForm of a complex number x+Iy is Complex:
Enter a complex number using the FullForm:
If the imaginary part is exactly zero, then the result is not Complex:
You have to use Re and Im to extract parts of Complex numbers:
Part does not work:
Enter a complex number with machine-number real and imaginary parts:
It is considered to be a machine number when both its real and imaginary parts are machine numbers:
Enter a complex number with arbitrary-precision real and imaginary parts:
The precision is based on the error in the complex plane:
Enter a complex number with an exact real part and an approximate imaginary part:
The exactness is kept in computations when possible:
can be used to stand for a complex number in a pattern:
A rule that switches real and imaginary parts:
An alternate definition:
Define a function over the complexes by using functions defined over the reals:
Complexes are numbers:
Complexes are atomic objects with no subexpressions:
Use Complexes to indicate assumptions on domain conditions:
Numbers entered in the form x+Iy only become Complex numbers on evaluation:
The unevaluated form is expressed in terms of Plus and Times:
New in 1