complexAbs function

double complexAbs(
  1. Complex a
)

Return a double that represent the absolute value of a complex number

Examples

var c1 = Complex(real: 3.0, imaginary: 4.0);

print(c1.abs());

/* output:
5.0
*/

Implementation

double complexAbs(Complex a) {
  return hypotenuse(a.real, a.imaginary);
}