-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComplex.h
More file actions
34 lines (27 loc) · 724 Bytes
/
Complex.h
File metadata and controls
34 lines (27 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include <iostream>
using namespace std;
class Complex
{
private:
double real;
double imaginary;
public:
Complex(void);
Complex(double real, double imaginary);
Complex(const Complex &other);
const Complex &operator=(const Complex &other);
double getReal() const {
return real;
}
double getImaginary() const {
return imaginary;
}
bool operator==(const Complex &other) const;
bool operator!=(const Complex &other) const;
Complex operator*() const;
};
ostream &operator<<(ostream &out, const Complex &c);
Complex operator+(const Complex &c1, const Complex &c2);
Complex operator+(const Complex &c1, double d);
Complex operator+(double d, const Complex &c1);