From mboxrd@z Thu Jan 1 00:00:00 1970 From: Edward E Meyer To: gcc-gnats@gcc.gnu.org Subject: libstdc++/4622: incorrect implementation of complex operator/= Date: Fri, 19 Oct 2001 13:56:00 -0000 Message-id: <200110192054.NAA64735@origin.ca.boeing.com> X-SW-Source: 2001-10/msg00403.html List-Id: >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: