[Bug c++/35389] New: error in norm() of STL

ywei at qualcomm dot com gcc-bugzilla@gcc.gnu.org
Wed Feb 27 10:45:00 GMT 2008


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



More information about the Gcc-bugs mailing list