home *** CD-ROM | disk | FTP | other *** search
- cxsqrt(a,b)
-
- /*subroutine finds the square root of a complex number.*/
-
- float a[],b[];
-
- {
- float c,d;
- extern double fabs(),sqrt();
-
- d = a[1];
- c = sqrt(a[0]*a[0] + a[1]*a[1]);
- b[1] = sqrt(fabs(.5*(-a[0] + c)));
- b[0] = sqrt(fabs(.5*(a[0] + c)));
- if(d < 0.0) b[1]=-b[1];
- }