complex Numbers using operator overloading
Posted on 2003-02-23
I'm having a little trouble creating a complex number class using operator overloading.
I have a class called ComplexNum and I have the constructors for that class. I know the formula's for using imaginary numbers but I don't know how to do the operator overloading for +,-,/,*. My book has a fraction sample program but it doesn't help me to understand how to do the binary operators. Like for addition its (a,b) + (c,d) = (a+c, b+d) How do I do that? Would one set be my real and one set my imaginary numbers. Any direction onto the right path would help. I think I'm making this harder than it is but I'm really frustrated right now! Thanks