Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ostream& operator<<(ostream& os, const Complex& c)
- {
- if (c.re!=0) {
- if (abs(c.re)>1e-5) os<<c.re;
- else os<<"0";
- }
- if (abs(c.im)>1e-5) {
- os<<((c.im>0)?"+":"-");
- if (abs(c.im)!=1) os<<abs(c.im);
- os<<"i";
- }
- return os;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement