V Qc@sddlZddlZejdZejdZdZdZddedZdZdZ d dd YZ d Z d d Z dZ edkre ndS(iNg@cCst|dot|dS(Ntretim(thasattr(tobj((s,/usr/lib64/python2.7/Demo/classes/Complex.pyt IsComplexGscCs7t|r|St|tr)t|St|SdS(N(Rt isinstancettupletComplex(R((s,/usr/lib64/python2.7/Demo/classes/Complex.pyt ToComplexJs   icCs5|t|}ttj||tj||S(N(ttwopiRtmathtcostsin(trtphit fullcircle((s,/usr/lib64/python2.7/Demo/classes/Complex.pytPolarToComplexRscCst|r|jS|S(N(RR(R((s,/usr/lib64/python2.7/Demo/classes/Complex.pytReVs cCst|r|jSdS(Ni(RR(R((s,/usr/lib64/python2.7/Demo/classes/Complex.pytIm[s RcBseZdddZdZdZdZdZdZdZdZ d Z d Z d Z d Z d ZdZe ZZedZeZdZeZdZdZdZeZdZdZddZdZRS(icCsd}d}t|r-|j}|j}n|}t|r\||j}||j}n ||}||jd<||jdcCsdG|GdG|Gyt|}Wntj}nXdG|GHt|tsZt|tri||k}nt|||k}|sdG|GdGt||GHndS(Ns tands->s!! !! !! should betdiff(tevaltsystexc_typeRtstrR@(texprtatbRtfuzztresulttok((s,/usr/lib64/python2.7/Demo/classes/Complex.pytcheckops  cCsdGHdtfd tfd!tdfd"tddfd#ttddfd$ttdddfd%tdtddfd&tdtdfd'tdtddfd(ttddtdd ff }ddg}x|D]x}|dcd7<|dd|djksH|dd|djkrd G|dGd G|dGH|dcd7As           J