libstdc++/4622: incorrect implementation of complex operator/=
Edward E Meyer
eem2314@origin.ca.boeing.com
Fri Oct 19 13:56:00 GMT 2001
>Number: 4622
>Category: libstdc++
>Synopsis: incorrect implementation of complex operator/=
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Fri Oct 19 13:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Edward E Meyer
>Release: 3.0.1
>Organization:
Boeing
>Environment:
System: IRIX64 origin 6.5 01101245 IP35
host: mips-sgi-irix6.5
build: mips-sgi-irix6.5
target: mips-sgi-irix6.5
configured with: ../gcc-3.0.1/configure --prefix=/acct/eem2314/local
>Description:
the implementation of the operator/= function for std template complex
is wrong - the sign is reversed on the imaginary part on line 240 of
libstdc++-v3/include/bits/std_complex.h
>How-To-Repeat:
>Fix:
--- std_complex.h Fri Oct 19 20:04:32 2001
+++ std_complex.h.patch Fri Oct 19 20:05:41 2001
@@ -237,7 +237,7 @@
{
const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag();
const _Tp __n = norm(__z);
- _M_imag = (_M_real * __z.imag() - _M_imag * __z.real()) / __n;
+ _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n;
_M_real = __r / __n;
return *this;
}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list