home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turbo Toolbox
/
Turbo_Toolbox.iso
/
sharew
/
f_2_c
/
libf77
/
pow_ii.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
C/C++ Source or Header
|
1991-06-10
|
267 b
|
26 lines
#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);
}