10 std::complex<double> value;
16 : value(real, imag) {};
27 return this->magnitude() >= other.magnitude();
32 return this->magnitude() > other.magnitude();
37 return this->magnitude() < other.magnitude();
40 friend std::ostream& operator<<(std::ostream& os,
const ComplexNumber& c)
48 this->value /= other.value;
54 this->value -= other.value;
60 this->value += other.value;
66 this->value *= other.value;
82 double magnitude()
const;
92 static std::vector<ComplexNumber> rootsOfUnity(
int n);
94 std::string toString()
const;
95 std::string toPolarString()
const;
97 std::complex<double> getValue()
const {
return value; }