home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 15
/
AACD15.ISO
/
AACD
/
Programming
/
Python2
/
Python20_source
/
Python
/
hypot.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
2000-10-25
|
280 b
|
24 lines
/* hypot() replacement */
#include "config.h"
#include "pyport.h"
double hypot(double x, double y)
{
double yx;
x = fabs(x);
y = fabs(y);
if (x < y) {
double temp = x;
x = y;
y = temp;
}
if (x == 0.)
return 0.;
else {
yx = y/x;
return x*sqrt(1.+yx*yx);
}
}