0

Hello,

I'm writing a a program in C++ that adds/subtracts complex numbers. I'm having trouble writing the square root of -1 or "i" in a complex number.

Complex number:

realPart + imaginaryPart * i (where i is /-1) ["square root of -1"]

so far I'm thinking the code is something like this, but don't know how to go abouts to writing the square root part.

```
double Complex::plusEq( Complex secondComplex )
{
double totalReal = real + secondComplex.getReal();
double totalImag = imaginary + secondComplex.getReal();
return totalReal + totalImag + // i; <--------- this part
}
```

I can't figure out how to write the commented "i".

Help please! ^^