This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug in complex::norm


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]