# Finding Re() and Im() for complex numbers

Hey guys,

Is there a way to find the real and imaginary parts of a complex number in Sage? If so, how is it done?

Thanks.

Finding Re() and Im() for complex numbers

Hey guys,

Is there a way to find the real and imaginary parts of a complex number in Sage? If so, how is it done?

Thanks.

add a comment

2

.real() for real part .imag() for imaginary part

For eg.

```
(3+i*4).real()=3
(3+i*4).imag()=4
```

0

real_part(z) and imag_part(z) also work.

Asked: **
2012-02-18 17:39:49 -0500
**

Seen: **4,345 times**

Last updated: **Feb 19 '12**

check if the result is a real number

where is the SageMath "Demonstrations Project"?

ask.sage forbidden goagent vpn ip?

How do you change the size of the sage/vm console buffer?

numerically integrating an expression containing 'i'

Difference between RealNumber and RealLiteral

how to obtain the real part of a complex function

Number field containing real/imaginary part of algebraic number

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.