From: "Joseph S. Myers" <jos...@codesourcery.com>
On Mon, 8 Jun 2009, Kaveh R. GHAZI wrote:
If I write a complex double constant -3.I (as opposed to 0-3.I), what is
it supposed to evaluate to? This program:
Because GCC does not implement imaginary types, this applies unary minus
to 0.0+3.0I. Whereas 0-3.I means 0.0 - (0.0+3.0I), a mixed real/complex
operation, the real part of whose result is 0.0 except when rounding
towards negative infinity when it is -0.0. There are lots of tests in
gcc.dg/torture/complex-sign*.
Okay thanks.
Perhaps the only safe way to create the value, even in the presence of
rounding mode changes, is to use conj(3.I) ?
--Kaveh