This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/48874] Sign of zeros sometimes lost in literals
- From: "jb at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 4 May 2011 17:15:02 +0000
- Subject: [Bug c/48874] Sign of zeros sometimes lost in literals
- Auto-submitted: auto-generated
- References: <bug-48874-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48874
Janne Blomqvist <jb at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #3 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-05-04 17:03:56 UTC ---
Ah, I see. while sizeof(I) == 8, due to the addition it gets expanded to (0.0,
1.0), and then, as you say, the negative zero is lost. So to generate the
literal constant (-0, 0) one needs
double _Complex c2 = -(0.0 - I*0.0);
Thank you both for the explanation.