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