repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2003-05-14 Eric Christopher <echristo@redhat.com>
[official-gcc.git]
/
libf2c
/
libF77
/
pow_qq.c
blob
0cec5ca7d8cb652d4cd3cba1577ee0b44e902b58
1
#include
"f2c.h"
2
3
longint
4
pow_qq
(
longint
*
ap
,
longint
*
bp
)
5
{
6
longint pow
,
x
,
n
;
7
unsigned long long
u
;
/* system-dependent */
8
9
x
= *
ap
;
10
n
= *
bp
;
11
12
if
(
n
<=
0
)
13
{
14
if
(
n
==
0
||
x
==
1
)
15
return
1
;
16
if
(
x
!= -
1
)
17
return
x
==
0
?
1
/
x
:
0
;
18
n
= -
n
;
19
}
20
u
=
n
;
21
for
(
pow
=
1
;;)
22
{
23
if
(
u
&
01
)
24
pow
*=
x
;
25
if
(
u
>>=
1
)
26
x
*=
x
;
27
else
28
break
;
29
}
30
return
(
pow
);
31
}