Previous Up Next

5.10.2  The real and imaginary parts of a complex number: re real im imag

The re (or real) and im (or imag) commands find the real and imaginary parts of a complex number.


The re command finds the real part of a complex number.
real is a synonym for re.

Example.

Input:

re(3+4*i)

Output:

3


The im command finds the imaginary part of a complex number.
imag is a synonym for im.

Example.

Input:

im(3+4*i)

Output:

4

Previous Up Next