mirror of
https://github.com/python/cpython.git
synced 2024-11-28 16:45:42 +01:00
32fbe59978
svn+ssh://pythondev@svn.python.org/python/trunk ........ r58940 | martin.v.loewis | 2007-11-12 05:53:02 +0100 (Mon, 12 Nov 2007) | 3 lines Only set rl_completion_display_matches_hook if there is a Python hook function. Fixes #1425. ........ r58941 | martin.v.loewis | 2007-11-12 06:14:05 +0100 (Mon, 12 Nov 2007) | 2 lines Patch #1418: Make the AC_REPLACE_FUNCS object files actually work. ........ r58942 | walter.doerwald | 2007-11-12 11:01:33 +0100 (Mon, 12 Nov 2007) | 2 lines Fix TextCalendar.prweek(). This closes issue #1427. ........
23 lines
260 B
C
23 lines
260 B
C
/* hypot() replacement */
|
|
|
|
#include "Python.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);
|
|
}
|
|
}
|