Add more construectors
This commit is contained in:
parent
1b4a1d5d61
commit
909c52ecfd
1 changed files with 12 additions and 0 deletions
12
cnumber.hpp
12
cnumber.hpp
|
@ -22,14 +22,26 @@ public:
|
|||
r = a;
|
||||
i = b;
|
||||
}
|
||||
cnumber(const fraction &a) {
|
||||
r = a;
|
||||
i = 0;
|
||||
}
|
||||
cnumber(int a, int b) {
|
||||
r = a;
|
||||
i = b;
|
||||
}
|
||||
cnumber(int a) {
|
||||
r = a;
|
||||
i = 0;
|
||||
}
|
||||
cnumber(double a, double b) {
|
||||
r = a;
|
||||
i = b;
|
||||
}
|
||||
cnumber(double a) {
|
||||
r = a;
|
||||
i = 0;
|
||||
}
|
||||
~cnumber() {}
|
||||
// Member functions
|
||||
cnumber conjugate() const {
|
||||
|
|
Loading…
Add table
Reference in a new issue