Staging
v0.5.1
https://github.com/python/cpython
Revision 28341ceb8f4f7f9b8edf5fbca9c9aa03e9606f08 authored by Martin v. Löwis on 05 September 2001, 15:18:00 UTC, committed by Martin v. Löwis on 05 September 2001, 15:18:00 UTC
1 parent b855216
Raw File
Tip revision: 28341ceb8f4f7f9b8edf5fbca9c9aa03e9606f08 authored by Martin v. Löwis on 05 September 2001, 15:18:00 UTC
Move UnixWare 7 defines to acconfig.h, regenerate pyconfig.h.in.
Tip revision: 28341ce
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