https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69086
--- Comment #2 from BENAÏSSA <ka_bena at yahoo dot fr> ---
thank you for your clear answer.comment: And I imagine that it is not possible
to define in C the complex value (inf,inf).
A.Benaïssa
Le Mercredi 30 décembre 2015 21h14, pinskia at gcc dot gnu.org
<[email protected]> a écrit :
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69086
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
A1_1 = 1.0e+0 / 0.0;
A2_2 = 1.0e+0 / 0.0;
A2.0_3 = A2_2;
_4 = A2.0_3 * 0.0;
_5 = _4 + A1_1;
A3_6 = COMPLEX_EXPR <_5, A2.0_3>;
_7 = (double) A1_1;
printf ("%f\n", _7);
_10 = REALPART_EXPR <A3_6>;
_11 = (double) _10;
printf ("%f\n", _11);
_13 = (double) A2_2;
printf ("%f\n", _13);
_15 = IMAGPART_EXPR <A3_6>;
_16 = (double) _15;
printf ("%f\n", _16);
_18 = 0;
The reason is more complex than what you think. Sorry for the pun. But since
there is no imagine type A2*1.Fi is really A2*(0 + 1Fi)
So for the real part you get:
A1 + A2 * 0
A2 * 0 is nan as inf * 0 is a nan.