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.


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

--- Comment #19 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2010-11-22 00:11:39 UTC ---
On Mon, 22 Nov 2010, sgk at troutmask dot apl.washington.edu wrote:

> We've had this discussion before.  Annex G, which I do acknowledge
> as informative, states:
> 
> The * and / operators satisfy the following infinity properties for
> all real, imaginary, and complex operands:319)
> 
> -- if one operand is an infinity and the other operand is a nonzero
>    finite number or an infinity, then the result of the * operator
>    is an infinity;
> 
> I'll note the above comes from n1124.pdf (page 468).  Perhaps,
> the actual C99 standard says something else.
> 
> -nan is not an infinity.

That -nan is not an infinity is true but irrelevant, because "A complex or 
imaginary value with at least one infinite part is regarded as an infinity 
(even if its other part is a NaN)." (G.3), so the complex result of the 
multiplication *is* an infinity (with one part NaN and one part infinity, 
which is a valid representation of complex infinity).


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