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.

Title: fix a bug mixing up 0.0 and-0.0
Type: Stage:
Components: Interpreter Core Versions: Python 2.6
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: aleax, christian.heimes, georg.brandl, loewis, mark.dickinson
Priority: normal Keywords: patch

Created on 2007-03-12 01:42 by aleax, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
neg0.patch aleax, 2007-03-12 01:42
Messages (7)
msg52182 - (view) Author: Alex Martelli (aleax) * (Python committer) Date: 2007-03-12 01:42
When 0.0 and -0.0 occur in the same compilation unit (e.g. function), the first one to occur gets used in lieu of all occurrences of the other. So, I've added a unittest to confirm this bug, and slightly tweaked an optimization performed in ast.c (_exactly_ along the lines of the similar tweak that's already there in the similar optimization performed in peephole.c) to remove the bug (which was not in the latest released 2.4 but keeps resurfacing -- hopefully no longer, w/the new unittest).
msg52183 - (view) Author: Alex Martelli (aleax) * (Python committer) Date: 2007-03-12 01:55
Forgot to mention that this patch fixes bug 1678380

msg52184 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2007-03-12 04:05
Works for me.

msg52185 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-03-12 09:16
I'm still doubtful whether this deserves fixing. However, if it does, it should produce different literals for +0j and -0j as well.
msg59797 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-01-12 05:19
See also #1678668.
msg59808 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-01-12 10:23
ITYM #1729014. :)
msg61465 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-01-21 23:22
This can be closed, I think:  it's already been fixed in the trunk (with a different 
fix, also due to Alex, from the one given here) and the fix has been backported to 

Not sure what the appropriate resolution is here;  plumping for 'out of date'.
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44702
2008-01-21 23:22:29mark.dickinsonsetstatus: open -> closed
resolution: out of date
messages: + msg61465
2008-01-12 10:23:03georg.brandlsetnosy: + georg.brandl
messages: + msg59808
2008-01-12 05:19:29christian.heimessetnosy: + christian.heimes
messages: + msg59797
2008-01-12 05:19:02christian.heimeslinkissue1729014 superseder
2007-03-12 01:42:23aleaxcreate