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
2004-07-12 David S. Miller <davem@nuts.davemloft.net>
[official-gcc.git]
/
libf2c
/
libF77
/
cabs.c
blob
5d2142e1825c61f8ecfc9a22639efb0244d27b05
1
#undef abs
2
#include <math.h>
3
double
4
f__cabs
(
double
real
,
double
imag
)
5
{
6
double
temp
;
7
8
if
(
real
<
0
)
9
real
= -
real
;
10
if
(
imag
<
0
)
11
imag
= -
imag
;
12
if
(
imag
>
real
)
13
{
14
temp
=
real
;
15
real
=
imag
;
16
imag
=
temp
;
17
}
18
if
((
real
+
imag
) ==
real
)
19
return
(
real
);
20
21
temp
=
imag
/
real
;
22
temp
=
real
*
sqrt
(
1.0
+
temp
*
temp
);
/*overflow!! */
23
return
(
temp
);
24
}