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

26 lines
245 B
C
Raw Permalink Normal View History

1991-10-07 16:59:33 +00:00
#include "f2c.h"
shortint pow_hh(ap, bp)
shortint *ap, *bp;
{
shortint 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);
}