cpplab/src/bmath/complex.hpp

29 lines
717 B
C++

#pragma once
#include "../platform/types.hpp"
#include <iostream>
using namespace std;
namespace BMath {
class Complex {
private:
int64 real;
int64 imaginary;
public:
Complex(int64 real, int64 imaginary);
Complex(const Complex &other);
Complex();
Complex &operator+=(const Complex &rightOp);
Complex operator+(const Complex &rightOp);
Complex operator-(const Complex &rigthOp);
Complex operator*(const Complex &rightOp);
int32 answer();
// Overload to enable toString operations
friend std::ostream &operator<<(std::ostream &stream,
BMath::Complex const &c) {
return stream << "(" << c.real << "+" << c.imaginary << "i)";
}
};
}; // namespace BMath