diff options
Diffstat (limited to 'contrib/libf2c/libF77/pow_ri.c')
-rw-r--r-- | contrib/libf2c/libF77/pow_ri.c | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/contrib/libf2c/libF77/pow_ri.c b/contrib/libf2c/libF77/pow_ri.c index 6e5816b..792db0c 100644 --- a/contrib/libf2c/libF77/pow_ri.c +++ b/contrib/libf2c/libF77/pow_ri.c @@ -1,35 +1,32 @@ #include "f2c.h" -#ifdef KR_headers -double pow_ri(ap, bp) real *ap; integer *bp; -#else -double pow_ri(real *ap, integer *bp) -#endif +double +pow_ri (real * ap, integer * bp) { -double pow, x; -integer n; -unsigned long u; + double pow, x; + integer n; + unsigned long u; -pow = 1; -x = *ap; -n = *bp; + pow = 1; + x = *ap; + n = *bp; -if(n != 0) + if (n != 0) + { + if (n < 0) { - if(n < 0) - { - n = -n; - x = 1/x; - } - for(u = n; ; ) - { - if(u & 01) - pow *= x; - if(u >>= 1) - x *= x; - else - break; - } + n = -n; + x = 1 / x; } -return(pow); + for (u = n;;) + { + if (u & 01) + pow *= x; + if (u >>= 1) + x *= x; + else + break; + } + } + return (pow); } |