This is the mail archive of the
gccbugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/20758] operator(const T&, const complex<T>&) vs operator(const complex<T>&, const complex<T>&)
 From: "gdr at integrablesolutions dot net" <gccbugzilla at gcc dot gnu dot org>
 To: gccbugs at gcc dot gnu dot org
 Date: 8 Apr 2005 14:15:57 0000
 Subject: [Bug libstdc++/20758] operator(const T&, const complex<T>&) vs operator(const complex<T>&, const complex<T>&)
 References: <20050404213802.20758.kreckel@ginac.de>
 Replyto: gccbugzilla at gcc dot gnu dot org
 Additional Comments From gdr at integrablesolutions dot net 20050408 14:15 
Subject: Re: operator(const T&, const complex<T>&) vs operator(const complex<T>&, const complex<T>&)
"kreckel at ginac dot de" <gccbugzilla@gcc.gnu.org> writes:
 (In reply to comment #11)
 > I think we need more careful analysis and tracking of both C99, C++ and
 > LIA3.

 Apart from looking at standards, we could also try to use our brains, right? It
 must be possible to answer the question whether the current behavior is right or
 not by analogy with real numbers, ie. simply by looking at the imaginary part alone.

 On systems without signed zero, there is no problem.

 On systems with 0.0, the code is trying to compute 0.0  0.0. Can that
 possibly be 0.0? If the answer is _no_, then this is a bug and it ought to be
 fixed. Period. If the asnwer is _yes_, then, well, then I'm bemazed and confused.
Thatis the mathematical question/answer. The real issue is this:
* in operator(const T&, const complex<T>&), should the imaginary
part eve be touched?
there are vairous ansewrs. And, yes we've been using our brains.

 BTW: I've always tought that systems that distinguish between 0.0 and 0.0, but
 not between 0.0 and +0.0 are slightly broken from a mathematical point of view.
If you ask me, any system with signed zeros is broken, to start with.
 Gaby

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