Facebook
From Fiona, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 142
  1. #ifndef COMPLEX_H
  2. #include <iostream>
  3. #include <ostream>
  4.  
  5. // represents complex numbers in cartesian form
  6. struct Complex {
  7.     double re;
  8.     double im;// todo
  9. };
  10.  
  11. // complex number output
  12. std::ostream& operator<< (std::ostream& cout, Complex c);
  13.  
  14. std::istream& operator>> (std::istream& cin, Complex c);
  15.  
  16. Complex operator+ (Complex& a, Complex& b);
  17.  
  18. Complex operator- (Complex& a, Complex& b);
  19.  
  20. Complex operator-(Complex a);
  21.  
  22. Complex operator* (Complex& a, Complex& b);
  23.  
  24. Complex operator/ (Complex& a, Complex& b);
  25.  
  26. bool operator== (Complex& a, Complex& b);
  27.  
  28. bool operator!= (Complex& a, Complex& b);
  29.  
  30. #endif