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: incomplete complex repr() with negative zeroes
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, lemburg, mark.dickinson, pitrou, stutzbach
Priority: normal Keywords:

Created on 2014-10-03 08:40 by pitrou, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (7)
msg228310 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-10-03 08:40
>>> complex(-0.0)
0j
>>> complex(-0.0).real
-0.0
msg228314 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2014-10-03 09:16
Where are you seeing this?

On an Ubuntu 13.10 x86 box, I see:

>>> complex(-0.0)
(-0+0j)

This is with 2.7.5+, 3.3.2+ (from Ubuntu distro), and with 3.5.0a0 and 3.4.2rc1+ built locally.
msg228315 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-10-03 09:17
Oh, my bad. This is with an Anaconda build of Python.
msg228316 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2014-10-03 09:20
No problem!

For completeness, I also see the correct behavior on cygwin 32-bit 2.7.3 and 3.2.3. I don't have access to a straight Windows version.
msg228342 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2014-10-03 17:19
Out of interest, what caused Anaconda to behave differently?  Is there some fragility that needs fixing in the Python core code?
msg228349 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-10-03 17:36
Actually, I realize it's not even Anaconda. I was just using a 2.6 interpreter, which apparently had a differently complex repr().
msg228350 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2014-10-03 17:38
Ah yes, that would make sense.  I vaguely remember fixing this between Python 2.6 and Python 2.7.
History
Date User Action Args
2022-04-11 14:58:08adminsetgithub: 66735
2014-10-03 17:38:16mark.dickinsonsetmessages: + msg228350
2014-10-03 17:36:56pitrousetmessages: + msg228349
2014-10-03 17:19:43mark.dickinsonsetmessages: + msg228342
2014-10-03 09:20:47eric.smithsetmessages: + msg228316
2014-10-03 09:17:22pitrousetstatus: open -> closed
resolution: works for me
messages: + msg228315

stage: resolved
2014-10-03 09:16:01eric.smithsetmessages: + msg228314
2014-10-03 08:40:44pitroucreate