This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: complex arithmetic in gcc (and various standards)
On Mon, 2 Oct 2006, Jan van Dijk wrote:
> On Monday 02 October 2006 12:57, Joseph S. Myers wrote:
> > On Mon, 2 Oct 2006, Jan van Dijk wrote:
> > > * the C99 and C++ standards say *nothing* about the details of compex
> > > multiplication
> >
> > The C99 standard says that real operands aren't converted to complex, but
> > as I note in bug 24581, the compiler doesn't expect PLUS_EXPR and
> > MULT_EXPR to have arguments of different types, so the front ends might
> > need adapting to handle real * complex and real + complex specially.
>
> Dear Joseph,
>
> My question was a slightly different one. To me it is not clear whether the
> standard allows the treatment of (r,0) as r in complex operations. For
> example: is it allowed to handle (r,0)*(x,y) as r*(x,y)?
I don't think so; at least, it might affect negative 0.
> I repeat my previous mail: there does not seem to be consensus about what
> standard(s) to implement (Annex G? LIA-x,...), and how to interpret the free
> space in those documents. Could you clarify?
Annex G, but without imaginary types for now. (I don't have enough
information to tell whether they are useful or desirable.)
> Triggered by 1*(Inf,0) = (Inf,NaN), I looked inside the compiler for the first
(Inf,NaN) is a valid complex infinity just as (Inf,0) is; see G.3.
--
Joseph S. Myers
joseph@codesourcery.com