Staging
v0.5.1
https://github.com/python/cpython
Revision 35c38eaeae8d24fe0098f3942135b3ba28cffe85 authored by Martin v. Löwis on 15 July 2003, 19:12:54 UTC, committed by Martin v. Löwis on 15 July 2003, 19:12:54 UTC
1 parent f393fc6
Raw File
Tip revision: 35c38eaeae8d24fe0098f3942135b3ba28cffe85 authored by Martin v. Löwis on 15 July 2003, 19:12:54 UTC
heck environment closed status before closing a cursors. Fixes #763928.
Tip revision: 35c38ea
hypot.c
/* hypot() replacement */

#include "pyconfig.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);
	}
}
back to top