This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/24581] Complex arithmetic on special cases is incorrect.
- From: "marco_atzeri at yahoo dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 22 Nov 2010 14:17:52 +0000
- Subject: [Bug c/24581] Complex arithmetic on special cases is incorrect.
- Auto-submitted: auto-generated
- References: <bug-24581-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24581
--- Comment #20 from marco atzeri <marco_atzeri at yahoo dot it> 2010-11-22 14:17:24 UTC ---
(In reply to comment #19)
> On Mon, 22 Nov 2010, sgk at troutmask dot apl.washington.edu wrote:
>
>
> 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).
I guess that I was misleaded by the status FIXED.
Following your reasoning INVALID or WONTFIX are probably more accurate
STATUS as the behaviour is not a BUG but a possible implementation.
As 0 * Inf = NaN on real/double, it follows that for complex
( 0 + I ) * Inf = 0 * Inf + I * Inf = NaN + I * Inf
however the implementation is not symmetric as
( 1 + I*0) * Inf = Inf + 0 * I
Of course (Inf + 0 * I) and (NaN + I * Inf) are both complex infinities,
but the lack of symmetry is inelegant ;-)
The table at C99 G.5.1-2 seems to suggest a symmetric behaviour, of course
IMHO