This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in complex::norm
- To: Joern Rennecke <amylaar at redhat dot com>
- Subject: Re: Bug in complex::norm
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 23 Aug 2001 14:25:07 +0200
- Cc: gdr at codesourcery dot com (Gabriel Dos Reis), loreti at pd dot infn dot it (Maurizio Loreti), gcc at gcc dot gnu dot org, nbecker at fred dot net
- Organization: CodeSourcery, LLC
- References: <200108221828.f7MISxc23607@phal.cambridge.redhat.com>
Joern Rennecke <amylaar@redhat.com> writes:
| > I don't recall if I changed norm's implementation, and if so I don't
| > recall why. But we should have a less inefficient implementation.
|
| Is norm required to be the euclidian norm? I would think that it is
| faster to compute the maximum norm.
Actually, this is a good example of where WG21 misnames concepts.
What Standard C++ defines to be norm() has no relation with what can
be called a norm in standard mathematic texts (or numerical analysis
texts). For C++, norm() is equivalent to the
real(z) * real(z) + imag(z) * imag(z)
abs_squared would have been a better name :-(
-- Gaby