repo.or.cz
/
python
/
dscho.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Added all documentation.
[python/dscho.git]
/
Python
/
hypot.c
blob
293aeb819c7ef59d79610161f1fa57ea2fc7dd9a
1
/* hypot() replacement */
2
3
#include
"config.h"
4
#include
"myproto.h"
5
#include
"mymath.h"
6
7
double
hypot
(
x
,
y
)
8
double
x
;
9
double
y
;
10
{
11
double
yx
;
12
13
x
=
fabs
(
x
);
14
y
=
fabs
(
y
);
15
if
(
x
<
y
) {
16
double
temp
=
x
;
17
x
=
y
;
18
y
=
temp
;
19
}
20
if
(
x
==
0
.)
21
return
0
.;
22
else
{
23
yx
=
y
/
x
;
24
return
x
*
sqrt
(
1
.+
yx
*
yx
);
25
}
26
}