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/24581] Complex arithmetic on special cases is incorrect.



------- Comment #4 from sgk at troutmask dot apl dot washington dot edu  2005-10-29 20:27 -------
Subject: Re:  Complex arithmetic on special cases is incorrect.

On Sat, Oct 29, 2005 at 08:09:45PM -0000, joseph at codesourcery dot com wrote:
> 
> >  * underflow, sign and efficiency bugs by rewriting I*y as
> >  * (0.0+I)*(y+0.0*I) and laboriously computing the full complex product.
> 
> Note that the correct form is (0.0+I)*y, since I is (per C99+TC1+TC2) 
> _Complex_I, of complex type (Annex G imaginary types conflicting with the 
> normative standard, unless and until anything changes in this respect 
> following DR#323).  But the usual arithmetic conversions as specified in 
> the standard do not convert both operands to complex, so one can be real 
> and one complex.
> 

If I read Annex G correctly, the z = I*inf = NaN + I inf
is going to really bad things because the NaN is going to
propagate if z is used in further computations.  Annex G
says z is an infinity.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24581


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