This is the mail archive of the gcc@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]

Re: complex arithmetic and signed zero?


On Wed, Oct 12, 2005 at 01:24:41PM -0700, Richard Henderson wrote:
> On Wed, Oct 12, 2005 at 10:49:44AM -0700, Steve Kargl wrote:
> > How does one set z = 0 - I 0 in a portable manner with gcc?
> 
>   z = conj(0);
> 

I came to your solution after posting my question.
Unfortunately, the point of my original question 
was missed.  gcc is not following Annex G in n1124.pdf.
In particular, see G.5.1  Multiplicative operators.

y = copysign(0, -1);
z = I * y; /* This should be computed as (i1)*(-0) = -i0 */
           /* Upon assignment to z, we have z = 0 - i0   */

-- 
Steve


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