c@427: #include "f2c.h" c@427: #ifdef __cplusplus c@427: extern "C" { c@427: #endif c@427: c@427: #ifdef KR_headers c@427: double pow_di(ap, bp) doublereal *ap; integer *bp; c@427: #else c@427: double pow_di(doublereal *ap, integer *bp) c@427: #endif c@427: { c@427: double pow, x; c@427: integer n; c@427: unsigned long u; c@427: c@427: pow = 1; c@427: x = *ap; c@427: n = *bp; c@427: c@427: if(n != 0) c@427: { c@427: if(n < 0) c@427: { c@427: n = -n; c@427: x = 1/x; c@427: } c@427: for(u = n; ; ) c@427: { c@427: if(u & 01) c@427: pow *= x; c@427: if(u >>= 1) c@427: x *= x; c@427: else c@427: break; c@427: } c@427: } c@427: return(pow); c@427: } c@427: #ifdef __cplusplus c@427: } c@427: #endif