operator + method

Complex operator +(
  1. Complex other
)

Adds two complex numbers component-wise.

Returns (a + c) + (b + d)i where this = a + bi and other = c + di.

Implementation

Complex operator +(Complex other) {
  return Complex(_real + other._real, _imag + other._imag);
}