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
* lib/objc.exp: Add -lposix4 on Solaris 2.8.
[official-gcc.git]
/
libf2c
/
libF77
/
pow_hh.c
blob
24a019734da152aa39bf9d6337363b430f377d2b
1
#include
"f2c.h"
2
3
#ifdef KR_headers
4
shortint
pow_hh
(
ap
,
bp
)
shortint
*
ap
, *
bp
;
5
#else
6
shortint
pow_hh
(
shortint
*
ap
,
shortint
*
bp
)
7
#endif
8
{
9
shortint pow
,
x
,
n
;
10
unsigned
u
;
11
12
x
= *
ap
;
13
n
= *
bp
;
14
15
if
(
n
<=
0
) {
16
if
(
n
==
0
||
x
==
1
)
17
return
1
;
18
if
(
x
!= -
1
)
19
return
x
==
0
?
1
/
x
:
0
;
20
n
= -
n
;
21
}
22
u
=
n
;
23
for
(
pow
=
1
; ; )
24
{
25
if
(
u
&
01
)
26
pow
*=
x
;
27
if
(
u
>>=
1
)
28
x
*=
x
;
29
else
30
break
;
31
}
32
return
(
pow
);
33
}