Bug in complex::norm

Gabriel Dos Reis gdr@codesourcery.com
Tue Aug 21 22:30:00 GMT 2001


nbecker@fred.net writes:

| I just updated to gcc-3.0.1 and found a problem with the
| implementation of complex::norm.
| 
| It seems that norm is now defined in terms of abs!

I don't recall what was the previous definition.  Why do you think it
is now wrong?  (Just a question, since I'm far from home and I don't
have an autorithative reference).  For float, double, and long double
(which are the types for which complex<T> is specified), that is
right.  No?

| This is not
| efficient and is wrong for non-float types.

Is complex<T> required to work with non-floating point types T?

-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com



More information about the Gcc mailing list