ack/lang/fortran/lib/libF77/pow_ii.c

26 lines
242 B
C
Raw Normal View History

1991-10-07 16:59:33 +00:00
#include "f2c.h"
integer pow_ii(ap, bp)
integer *ap, *bp;
{
integer pow, x, n;
pow = 1;
x = *ap;
n = *bp;
if(n < 0)
{ }
else if(n > 0)
for( ; ; )
{
if(n & 01)
pow *= x;
if(n >>= 1)
x *= x;
else
break;
}
return(pow);
}