* java/util/zip/ZipEntry.java (ZipEntry(String)): When name is bigger
[official-gcc.git] / libf2c / libF77 / z_sqrt.c
blob954c2fa18896f99cdc2cfecb3f2ba985dd2ebaa5
1 #include "f2c.h"
3 #undef abs
4 #include "math.h"
5 extern double f__cabs (double, double);
6 void
7 z_sqrt (doublecomplex * r, doublecomplex * z)
9 double mag, zi = z->i, zr = z->r;
11 if ((mag = f__cabs (zr, zi)) == 0.)
12 r->r = r->i = 0.;
13 else if (zr > 0)
15 r->r = sqrt (0.5 * (mag + zr));
16 r->i = zi / r->r / 2;
18 else
20 r->i = sqrt (0.5 * (mag - zr));
21 if (zi < 0)
22 r->i = -r->i;
23 r->r = zi / r->i / 2;