Issue 1678668: fix a bug mixing up 0.0 and-0.0 (original) (raw)

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

Files
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 Alex
msg52184 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2007-03-12 04:05
Works for me. Mark
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 2.5.2. Not sure what the appropriate resolution is here; plumping for 'out of date'.
History
Date User Action Args
2022-04-11 14:56:23 admin set github: 44702
2008-01-21 23:22:29 mark.dickinson set status: open -> closedresolution: out of datemessages: +
2008-01-12 10:23:03 georg.brandl set nosy: + georg.brandlmessages: +
2008-01-12 05:19:29 christian.heimes set nosy: + christian.heimesmessages: +
2008-01-12 05:19:02 christian.heimes link issue1729014 superseder
2007-03-12 01:42:23 aleax create