This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/48874] Sign of zeros sometimes lost in literals


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]