This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: A suggested change
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Padmanabhan.Tr, geoffreyspear
Priority: normal Keywords:

Created on 2014-10-01 14:27 by Padmanabhan.Tr, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg228073 - (view) Author: Padmanabhan Tr (Padmanabhan.Tr) * Date: 2014-10-01 14:27
Take a complex number n = 3+4j. n.real is taken as 3.0 & n.imag as 4.0 in Python3.  One has to use the int(0 function to get back the parts as integers.  I guess this is a compiler error?
msg228076 - (view) Author: Geoffrey Spear (geoffreyspear) * Date: 2014-10-01 14:47
From the documentation: "Complex numbers have a real and imaginary part, which are each a floating point number."

Needing to use int() to convert these floats to integers is not a bug, it's the expected behavior.
msg228080 - (view) Author: Padmanabhan Tr (Padmanabhan.Tr) * Date: 2014-10-01 16:04
Dear Mr SpearThanks for the prompt response & clarification.(in Python) If the real & imaginary parts of numbers you deal with are integers, results of operations (except division)  - like +, -, *, **, - appear with respective integers as real & imginary parts.  In line with these, changes in '.real' & '.imag' may be desirable?

     On Wednesday, October 1, 2014 8:19 PM, Eric V. Smith <report@bugs.python.org> wrote:

Changes by Eric V. Smith <eric@trueblade.com>:

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue22532>
_______________________________________
msg228081 - (view) Author: Padmanabhan Tr (Padmanabhan.Tr) * Date: 2014-10-01 16:04
Dear Mr SpearThanks for the prompt response & clarification.(in Python) If the real & imaginary parts of numbers you deal with are integers, results of operations (except division)  - like +, -, *, **, - appear with respective integers as real & imginary parts.  In line with these, changes in '.real' & '.imag' may be desirable?

     On Wednesday, October 1, 2014 8:19 PM, Eric V. Smith <report@bugs.python.org> wrote:

Changes by Eric V. Smith <eric@trueblade.com>:

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue22532>
_______________________________________
History
Date User Action Args
2022-04-11 14:58:08adminsetgithub: 66722
2014-10-01 16:04:25Padmanabhan.Trsetmessages: + msg228081
2014-10-01 16:04:25Padmanabhan.Trsetmessages: + msg228080
2014-10-01 14:49:19eric.smithsetstatus: open -> closed
resolution: not a bug
stage: resolved
2014-10-01 14:48:40geoffreyspearsettype: compile error -> behavior
components: + Interpreter Core
2014-10-01 14:47:45geoffreyspearsetnosy: + geoffreyspear
messages: + msg228076
2014-10-01 14:27:46Padmanabhan.Trcreate