This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [libstdc++-v3] Typo in std_complex.h (sqrt), patch included


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]