[complex.value.ops] (original) (raw)

26 Numerics library [numerics]

26.4 Complex numbers [complex.numbers]

26.4.7 Value operations [complex.value.ops]

template<class T> constexpr T real(const complex<T>& x);

template<class T> constexpr T imag(const complex<T>& x);

template<class T> T abs(const complex<T>& x);

Returns:The magnitude of x.

template<class T> T arg(const complex<T>& x);

Returns:The phase angle of x, or atan2(imag(x), real(x)).

template<class T> constexpr T norm(const complex<T>& x);

Returns:The squared magnitude of x.

template<class T> constexpr complex<T> conj(const complex<T>& x);

Returns:The complex conjugate of x.

template<class T> complex<T> proj(const complex<T>& x);

Returns:The projection of x onto the Riemann sphere.

Remarks:Behaves the same as the C function cproj.

See also: ISO C 7.3.9.5

template<class T> complex<T> polar(const T& rho, const T& theta = T());

Preconditions: rho is non-negative and non-NaN.

theta is finite.

Returns:Thecomplexvalue corresponding to a complex number whose magnitude is rho and whose phase angle is theta.