Add subtraction

main
Micke Nordin 5 years ago
parent 8892c7851f
commit 523f2fc0b6

@ -28,7 +28,11 @@ class cnumber {
// Operators // Operators
cnumber operator+(const cnumber &that) { cnumber operator+(const cnumber &that) {
cnumber z(that.r + this->r, that.i + this->i); cnumber z(this->r + that.r, this->i + that.i);
return z;
}
cnumber operator-(const cnumber &that) {
cnumber z(this->r - that.r, this->i - that.i);
return z; return z;
} }
cnumber operator*(const cnumber &that) { cnumber operator*(const cnumber &that) {

Loading…
Cancel
Save