Staging
v0.5.1
Revision 55d3a19643b00ff8f54aac7b3aeeeb4a62ec7e7a authored by Walter Dörwald on 10 January 2005, 12:26:00 UTC, committed by Walter Dörwald on 10 January 2005, 12:26:00 UTC
Fix and test for SF bug #1098990: codec readline() splits lines apart.
1 parent 9632e94
Raw File
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