Staging
v0.8.1
https://github.com/python/cpython
Revision 72959cc3f7f95a805648679739d419d5dc2f0b57 authored by Fred Drake on 11 May 2004, 14:37:25 UTC, committed by Fred Drake on 11 May 2004, 14:37:25 UTC
1 parent 04b3734
Raw File
Tip revision: 72959cc3f7f95a805648679739d419d5dc2f0b57 authored by Fred Drake on 11 May 2004, 14:37:25 UTC
use tools/getversioninfo to extract the version number from the Python
Tip revision: 72959cc
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