|
|
@ -10,6 +10,10 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
// Constructor
|
|
|
|
// Constructor
|
|
|
|
|
|
|
|
cnumber() {
|
|
|
|
|
|
|
|
r = 0;
|
|
|
|
|
|
|
|
i = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
cnumber(const cnumber &z) {
|
|
|
|
cnumber(const cnumber &z) {
|
|
|
|
r = z.r;
|
|
|
|
r = z.r;
|
|
|
|
i = z.i;
|
|
|
|
i = z.i;
|
|
|
@ -26,6 +30,7 @@ public:
|
|
|
|
r = a;
|
|
|
|
r = a;
|
|
|
|
i = b;
|
|
|
|
i = b;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
~cnumber() {}
|
|
|
|
// Member functions
|
|
|
|
// Member functions
|
|
|
|
cnumber conjugate() const {
|
|
|
|
cnumber conjugate() const {
|
|
|
|
fraction a(this->r.get_n(), this->r.get_d());
|
|
|
|
fraction a(this->r.get_n(), this->r.get_d());
|
|
|
|