Ruby
2.0.0p598(2014-11-13revision48408)
Main Page
Modules
Data Structures
Files
File List
Globals
missing
hypot.c
Go to the documentation of this file.
1
/* public domain rewrite of hypot */
2
3
#include "
ruby/missing.h
"
4
#include <math.h>
5
6
double
hypot
(
double
x,
double
y)
7
{
8
if
(x < 0) x = -x;
9
if
(y < 0) y = -y;
10
if
(x < y) {
11
double
tmp
= x;
12
x = y; y =
tmp
;
13
}
14
if
(y == 0.0)
return
x;
15
y /= x;
16
return
x * sqrt(1.0+y*y);
17
}
tmp
volatile VALUE tmp
Definition:
tcltklib.c:10208
missing.h
hypot
RUBY_EXTERN double hypot(double, double)
Definition:
hypot.c:6
Generated on Fri Nov 14 2014 16:00:07 for Ruby by
1.8.5