Skip to content

Commit a338b40

Browse files
committed
imporve formatting in code
1 parent 8f02c1e commit a338b40

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Objects/complexobject.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,21 +368,23 @@ c_powu(Py_complex x, long n)
368368
static Py_complex
369369
c_powi(Py_complex x, long n)
370370
{
371-
if (n > 0) {
371+
if (n > 0)
372372
return c_powu(x, n);
373-
}
374-
if (n == 0) {
373+
else if (n == 0)
375374
return (Py_complex){1., 0.};
376-
}
375+
377376
double m = fabs(x.real) > fabs(x.imag) ? x.real : x.imag;
377+
378378
if (m && isfinite(m)) {
379379
int e;
380+
380381
frexp(m, &e);
382+
381383
if (-e*n > 800) {
382384
x = (Py_complex){ldexp(x.real, -e), ldexp(x.imag, -e)};
383385
x = _Py_rc_quot(1.0, c_powu(x, -n));
384-
x.real = ldexp(x.real, (int)(e*n));
385-
x.imag = ldexp(x.imag, (int)(e*n));
386+
x.real = ldexp(x.real, (int)(e * n));
387+
x.imag = ldexp(x.imag, (int)(e * n));
386388
return x;
387389
}
388390
}

0 commit comments

Comments
 (0)