| 290 | |
| 291 | #ifdef KR_headers |
| 292 | VOID pow_zi(p, a, b) /* p = a**b */ |
| 293 | doublecomplex *p, *a; integer *b; |
| 294 | #else |
| 295 | extern void z_div(doublecomplex*, doublecomplex*, doublecomplex*); |
| 296 | void pow_zi(doublecomplex *p, doublecomplex *a, integer *b) /* p = a**b */ |
| 297 | #endif |
| 298 | { |
| 299 | integer n; |
| 300 | unsigned long u; |
| 301 | double t; |
| 302 | doublecomplex q, x; |
| 303 | static doublecomplex one = {1.0, 0.0}; |
| 304 | |
| 305 | n = *b; |
| 306 | q.r = 1; |
| 307 | q.i = 0; |
| 308 | |
| 309 | if(n == 0) |
| 310 | goto done; |
| 311 | if(n < 0) |
| 312 | { |
| 313 | n = -n; |
| 314 | z_div(&x, &one, a); |
| 315 | } |
| 316 | else |
| 317 | { |
| 318 | x.r = a->r; |