Staging
v0.5.1
https://github.com/python/cpython
Revision 78a25695cbff5b8159b09e8b067eb549f5f58a4a authored by Moshe Zadka on 30 March 2001, 13:55:52 UTC, committed by Moshe Zadka on 30 March 2001, 13:55:52 UTC
1 parent 0cf3bad
Raw File
Tip revision: 78a25695cbff5b8159b09e8b067eb549f5f58a4a authored by Moshe Zadka on 30 March 2001, 13:55:52 UTC
Documenting the _curses bug fix.
Tip revision: 78a2569
hypot.c
/* 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);
	}
}
back to top