# csgn(x) is Complex signum function, if x is real, then csgn(x)=sgn(x); csgn(x_):= if(x>0,1,if(x<0, -1,if(isreal(x),sgn(x) )));