public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35389]  New: error in norm() of STL
@ 2008-02-27 10:45 ywei at qualcomm dot com
  2008-02-27 12:44 ` [Bug c++/35389] " rguenth at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ywei at qualcomm dot com @ 2008-02-27 10:45 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-27 20:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-27 10:45 [Bug c++/35389] New: error in norm() of STL ywei at qualcomm dot com
2008-02-27 12:44 ` [Bug c++/35389] " rguenth at gcc dot gnu dot org
2008-02-27 12:44 ` rguenth at gcc dot gnu dot org
2008-02-27 20:13 ` ywei at qualcomm dot com
2008-02-27 20:31 ` pluto at agmk dot net
2008-02-27 20:39 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).