Add subtraction
This commit is contained in:
parent
8892c7851f
commit
523f2fc0b6
1 changed files with 5 additions and 1 deletions
|
@ -28,7 +28,11 @@ class cnumber {
|
|||
|
||||
// Operators
|
||||
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;
|
||||
}
|
||||
cnumber operator*(const cnumber &that) {
|
||||
|
|
Loading…
Add table
Reference in a new issue