Defined in header <complex> template< class T >
T abs( const complex<T>& z );
Returns the magnitude of the complex number z.
Parameters
z - complex value
Return value
If no errors occur, returns the absolute value (also known as norm, modulus, or magnitude) of z.
Errors and special cases are handled as if the function is implemented as std::hypot(std::real(z), std::imag(z)).
Examples
#include <iostream>
#include <complex>
in