diff xcomplex.h @ 10:c6528c38b23c

a few minor fixes
author Wen X <xue.wen@elec.qmul.ac.uk>
date Thu, 28 Jul 2011 10:36:57 +0100
parents 5f3c32dc6e17
children 977f541d6683
line wrap: on
line diff
--- a/xcomplex.h	Fri Oct 15 14:54:51 2010 +0100
+++ b/xcomplex.h	Thu Jul 28 10:36:57 2011 +0100
@@ -26,8 +26,8 @@
   T imag(){return y;}
 
   cmplx<T>& operator=(const T& c){x=c; y=0; return *this;}
-  template<class X> cmplx<T>& operator+=(const X& c){x+=c; y=0; return *this;}
-  template<class X> cmplx<T>& operator-=(const X& c){x-=c; y=0; return *this;}
+  template<class X> cmplx<T>& operator+=(const X& c){x+=c; return *this;}
+  template<class X> cmplx<T>& operator-=(const X& c){x-=c; return *this;}
   template<class X> cmplx<T>& operator*=(const X& c){x*=c; y*=c; return *this;}
   template<class X> cmplx<T>& operator/=(const X& c){x/=c; y/=c; return *this;}
   template<class X> cmplx<T>& operator=(const cmplx<X>& c){x=c.x; y=c.y; return* this;}