This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [libstdc++-v3] Typo in std_complex.h (sqrt), patch included
- To: Peter Schmid <schmid at snake dot iap dot physik dot tu-darmstadt dot de>, bkoz at redhat dot com
- Subject: Re: [libstdc++-v3] Typo in std_complex.h (sqrt), patch included
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 10 Jan 2001 21:49:25 +0100
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.4.21.0101102113520.12282-100000@snake.iap.physik.tu-darmstadt.de>
Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de> writes:
| I believe there is a typo in line 467 of std_complex.h in function
| template<typename _Tp> complex<_Tp> sqrt(const complex<_Tp>& __z).
| The factor two should multiply the modulus of the complex number
| \emph{and} of the real part of that number. Otherwise incorrect results
| are obtained. For example without the patch the square root of 1 + i
| yields (0.978318,0.511081) instead of the correct result (1.09868,0.45509).
Thanks!
Benjamin, please could you install that patch? Thanks in advance.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com