      SUBROUTINE WSIGN (XR, XI, YR, YI, ZR, ZI)
      IMPLICIT NONE
C
C IF Y.NE.0, Z = X*Y/ABS (Y)
C IF Y.EQ.0, Z = X
C
      DOUBLE PRECISION XR, XI, YR, YI, ZR, ZI
C
      DOUBLE PRECISION T
C
      DOUBLE PRECISION PYTHAG
C
C
      T = PYTHAG (YR, YI)
      ZR = XR
      ZI = XI
      IF (T.NE.0.0D0) CALL WMUL (YR/T, YI/T, ZR, ZI, ZR, ZI)
C
      RETURN
      END
