repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git]
/
missing
/
hypot.c
blob
5a663553cfc9117ddcf068ea0d745c943739ca33
1
/* public domain rewrite of hypot */
2
3
#include <math.h>
4
5
double
hypot
(
double
x
,
double
y
)
6
{
7
if
(
x
<
0
)
x
= -
x
;
8
if
(
y
<
0
)
y
= -
y
;
9
if
(
x
<
y
) {
10
double
tmp
=
x
;
11
x
=
y
;
y
=
tmp
;
12
}
13
if
(
y
==
0.0
)
return
x
;
14
y
/=
x
;
15
return
x
*
sqrt
(
1.0
+
y
*
y
);
16
}