std::norm(std::complex)
| Defined in header <complex>
|
||
| (1) | ||
| template< class T > T norm( const std::complex<T>& z ); |
(until C++20) | |
| template< class T > constexpr T norm( const std::complex<T>& z ); |
(since C++20) | |
| (2) | ||
| float norm( float z ); template< class DoubleOrInteger > |
(since C++11) (until C++20) |
|
| constexpr float norm( float z ); template< class DoubleOrInteger > |
(since C++20) | |
z.|
2) Additional overloads are provided for float, double, long double, and all integer types, which are treated as complex numbers with zero imaginary component.
|
(since C++11) |
Contents |
[edit] Parameters
| z | - | complex value |
[edit] Return value
the squared magnitude of z
[edit] Notes
The norm calculated by this function is also known as field norm or absolute square.
The Euclidean norm of a complex number is provided by std::abs, which is more costly to compute. In some situations, it may be replaced by std::norm, for example, if abs(z1) > abs(z2) then norm(z1) > norm(z2).
[edit] See also
| returns the magnitude of a complex number (function template) | |
| returns the complex conjugate (function template) | |
| constructs a complex number from magnitude and phase angle (function template) |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
