This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35389] New: error in norm() of STL
- From: "ywei at qualcomm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Feb 2008 10:44:42 -0000
- Subject: [Bug c++/35389] New: error in norm() of STL
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
There is something wrong with the norm() in STL to get the norm2 of complex
numbers.
Suppose we have complex<double> x(8,1), the norm of x should be 8*8 + 1*1 = 65,
but norm(x) returns 64, which is incorrect.
If we do complex<float> x(8,1), there is no problem, norm(x) does return 65.
The issue is not limited to version 4.2.1. It is observed in other versions as
well.
--
Summary: error in norm() of STL
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ywei at qualcomm dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35389